- x = gsl_matrix_get (data, i, j);
-
- if (!gsl_isnan (x))
- {
- x -= est[j]->mean;
- for (lag = 1; lag <= max_lag && lag < (data->size1 - i); lag++)
- {
- y = gsl_matrix_get (data, i + lag, j);
- if (!gsl_isnan (y))
- {
- y -= est[j]->mean;
- *(est[j]->cov + lag - 1) += y * x;
- est[j]->n_obs += 1.0;
- }
- }
- }
+ update_cov (est, gsl_matrix_const_row (data, i),
+ gsl_matrix_const_row (data, i + lag), lag);