#include <config.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_vector.h>
-#include <gsl/gsl_math.h>
#include <stdlib.h>
-#include <libpspp/alloc.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)
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;
{
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;
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;
}