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