projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linreg.c: (pspp_linreg_mse) New accessor function
[pspp-builds.git]
/
src
/
math
/
ts
/
innovations.c
diff --git
a/src/math/ts/innovations.c
b/src/math/ts/innovations.c
index f69cf89874c530564f7a2182d46915939dd6a19a..b9a7cf223442a42ce597748320647a23a0739939 100644
(file)
--- a/
src/math/ts/innovations.c
+++ b/
src/math/ts/innovations.c
@@
-28,13
+28,13
@@
#include <config.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_vector.h>
#include <config.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_vector.h>
-#include <gsl/gsl_math.h>
#include <stdlib.h>
#include <stdlib.h>
-#include <libpspp/alloc.h>
#include <libpspp/compiler.h>
#include <math/coefficient.h>
#include <math/ts/innovations.h>
#include <libpspp/compiler.h>
#include <math/coefficient.h>
#include <math/ts/innovations.h>
+#include "xalloc.h"
+
static void
get_mean (const gsl_matrix *data,
struct innovations_estimate **est)
static void
get_mean (const gsl_matrix *data,
struct innovations_estimate **est)
@@
-55,7
+55,7
@@
get_mean (const gsl_matrix *data,
for (n = 0; n < data->size2; n++)
{
tmp = gsl_matrix_get (data, i, n);
for (n = 0; n < data->size2; n++)
{
tmp = gsl_matrix_get (data, i, n);
- if (!
gsl_
isnan (tmp))
+ if (!isnan (tmp))
{
est[n]->n_obs += 1.0;
d = (tmp - est[n]->mean) / est[n]->n_obs;
{
est[n]->n_obs += 1.0;
d = (tmp - est[n]->mean) / est[n]->n_obs;
@@
-76,9
+76,9
@@
update_cov (struct innovations_estimate **est, gsl_vector_const_view x,
{
xj = gsl_vector_get (&x.vector, j);
yj = gsl_vector_get (&y.vector, j);
{
xj = gsl_vector_get (&x.vector, j);
yj = gsl_vector_get (&y.vector, j);
- if (!
gsl_
isnan (xj))
+ if (!isnan (xj))
{
{
- if (!
gsl_
isnan (yj))
+ if (!isnan (yj))
{
xj -= est[j]->mean;
yj -= est[j]->mean;
{
xj -= est[j]->mean;
yj -= est[j]->mean;
@@
-160,7
+160,7
@@
innovations_update_scale (struct innovations_estimate *est, double *theta,
for (j = 0; j < i; j++)
{
k = i - j - 1;
for (j = 0; j < i; j++)
{
k = i - j - 1;
- result -=
theta[k] * theta[k]
* est->scale[j];
+ result -=
pow2 (theta[k])
* est->scale[j];
}
est->scale[i] = result;
}
}
est->scale[i] = result;
}