f0e40c59f7e2400b0d47609534a14ba1e64c3580
[pspp-builds.git] / src / math / ts / innovations.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 2006 Free Software Foundation, Inc.
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16 /*
17   Find preliminary ARMA coefficients via the innovations algorithm.
18   Also compute the sample mean and covariance matrix for each series.
19
20   Reference:
21
22   P. J. Brockwell and R. A. Davis. Time Series: Theory and
23   Methods. Second edition. Springer. New York. 1991. ISBN
24   0-387-97429-6. Sections 5.2, 8.3 and 8.4.
25  */
26 #ifndef INNOVATIONS_H
27 #define INNOVATIONS_H
28 #include <math/coefficient.h>
29 #include <math/design-matrix.h>
30
31 struct innovations_estimate
32 {
33   const struct variable *variable;
34   double mean;
35   double *cov;
36   double *scale;
37   double n_obs;
38   double max_lag;
39   coefficient **coeff;
40 };
41 struct innovations_estimate ** pspp_innovations (const struct design_matrix *, size_t);
42 void pspp_innovations_free (struct innovations_estimate **, size_t);
43 #endif