-struct innovations_estimate ** pspp_innovations (const struct variable **vars, size_t *n_vars,
- size_t lag, const struct casefile *cf)
+static void
+innovations_struct_init (struct innovations_estimate *est,
+ const struct design_matrix *dm,
+ size_t lag)
+{
+ size_t j;
+
+ est->mean = 0.0;
+ /* COV[0] stores the lag 0 covariance (i.e., the variance), COV[1]
+ holds the lag-1 covariance, etc.
+ */
+ est->cov = xnmalloc (lag + 1, sizeof (*est->cov));
+ est->scale = xnmalloc (lag + 1, sizeof (*est->scale));
+ est->coeff = xnmalloc (lag, sizeof (*est->coeff)); /* No intercept. */
+
+ /*
+ The loop below is an unusual use of PSPP_COEFF_INIT(). In a
+ typical model, one column of a DESIGN_MATRIX has one
+ coefficient. But in a time-series model, one column has many
+ coefficients.
+ */
+ for (j = 0; j < lag; j++)
+ {
+ pspp_coeff_init (est->coeff + j, dm);
+ }
+ est->max_lag = (double) lag;
+}
+
+struct innovations_estimate **
+pspp_innovations (const struct design_matrix *dm, size_t lag)