[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] pspp/src/math/ts ChangeLog innovations.c innova...
From: |
Jason H Stover |
Subject: |
[Pspp-cvs] pspp/src/math/ts ChangeLog innovations.c innova... |
Date: |
Thu, 13 Jul 2006 20:44:45 +0000 |
CVSROOT: /sources/pspp
Module name: pspp
Changes by: Jason H Stover <jstover> 06/07/13 20:44:45
Modified files:
src/math/ts : ChangeLog innovations.c innovations.h
Log message:
use struct design_matrix
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/math/ts/ChangeLog?cvsroot=pspp&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/pspp/src/math/ts/innovations.c?cvsroot=pspp&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/pspp/src/math/ts/innovations.h?cvsroot=pspp&r1=1.4&r2=1.5
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/pspp/pspp/src/math/ts/ChangeLog,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- ChangeLog 6 Jul 2006 23:58:05 -0000 1.11
+++ ChangeLog 13 Jul 2006 20:44:44 -0000 1.12
@@ -1,3 +1,8 @@
+2006-07-13 Jason Stover <address@hidden>
+
+ * innovations.c (pspp_innovations): Altered function to use struct
+ design_matrix.
+
2006-07-06 Jason Stover <address@hidden>
* innovations.c (get_covariance): Fixed subscripts.
Index: innovations.c
===================================================================
RCS file: /sources/pspp/pspp/src/math/ts/innovations.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- innovations.c 6 Jul 2006 23:58:05 -0000 1.12
+++ innovations.c 13 Jul 2006 20:44:44 -0000 1.13
@@ -110,13 +110,11 @@
}
}
}
- for (lag = 1; lag <= max_lag; lag++)
- {
for (j = 0; j < data->size2; j++)
{
- *(est[j]->cov + lag - 1) /= (est[j]->n_obs - lag);
- }
+ *(est[j]->cov + lag - 1) /= est[j]->n_obs;
}
+
return rc;
}
static double
@@ -257,22 +255,22 @@
}
struct innovations_estimate **
-pspp_innovations (const gsl_matrix *data, size_t lag)
+pspp_innovations (const struct design_matrix *dm, size_t lag)
{
struct innovations_estimate **est;
size_t i;
- est = xnmalloc (data->size2, sizeof *est);
- for (i = 0; i < data->size2; i++)
+ est = xnmalloc (dm->m->size2, sizeof *est);
+ for (i = 0; i < dm->m->size2; i++)
{
est[i] = xmalloc (sizeof *est[i]);
/* est[i]->variable = vars[i]; */
innovations_struct_init (est[i], lag);
}
- get_mean_variance (data, est);
- get_covariance (data, est, lag);
- get_coef (data, est, lag);
+ get_mean_variance (dm->m, est);
+ get_covariance (dm->m, est, lag);
+ get_coef (dm->m, est, lag);
return est;
}
Index: innovations.h
===================================================================
RCS file: /sources/pspp/pspp/src/math/ts/innovations.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- innovations.h 3 Jul 2006 19:41:20 -0000 1.4
+++ innovations.h 13 Jul 2006 20:44:44 -0000 1.5
@@ -30,6 +30,8 @@
#ifndef INNOVATIONS_H
#define INNOVATIONS_H
#include <math/coefficient.h>
+#include <math/design-matrix.h>
+
struct innovations_estimate
{
const struct variable *variable;
@@ -41,6 +43,6 @@
double max_lag;
coefficient **coeff;
};
-struct innovations_estimate ** pspp_innovations (const gsl_matrix *, size_t);
+struct innovations_estimate ** pspp_innovations (const struct design_matrix *,
size_t);
void pspp_innovations_free (struct innovations_estimate **, size_t);
#endif