-struct pspp_linreg_cache_struct
-{
- int n_obs; /* Number of observations. */
- int n_indeps; /* Number of independent variables. */
- int n_coeffs; /* The intercept is not considered a
- coefficient here. */
-
- /*
- Pointer to the dependent variable.
- */
- const struct variable *depvar;
-
- gsl_vector *residuals;
- struct pspp_coeff **coeff;
- double intercept;
- int method; /* Method to use to estimate parameters. */
- /*
- Means and standard deviations of the variables.
- If these pointers are null when pspp_linreg() is
- called, pspp_linreg() will compute their values.
-
- Entry i of indep_means is the mean of independent
- variable i, whose observations are stored in the ith
- column of the design matrix.
- */
- double depvar_mean;
- double depvar_std;
- gsl_vector *indep_means;
- gsl_vector *indep_std;
-
- /*
- Sums of squares.
- */
- double ssm; /* Sums of squares for the overall model. */
- gsl_vector *ss_indeps; /* Sums of squares from each
- independent variable. */
- double sst; /* Sum of squares total. */
- double sse; /* Sum of squares error. */
- double mse; /* Mean squared error. This is just sse /
- dfe, but since it is the best unbiased
- estimate of the population variance, it
- has its own entry here. */
- gsl_vector *ssx; /* Centered sums of squares for independent
- variables, i.e. \sum (x[i] - mean(x))^2. */
- double ssy; /* Centered sums of squares for dependent
- variable.
- */
- /*
- Covariance matrix of the parameter estimates.
- */
- gsl_matrix *cov;
- /*
- Degrees of freedom.
- */
- double dft;
- double dfe;
- double dfm;
-
- /*
- 'Hat' or Hessian matrix, i.e. (X'X)^{-1}, where X is our
- design matrix.
- */
- gsl_matrix *hat;
-
- double (*predict) (const struct variable **, const union value **,
- const void *, int);
- double (*residual) (const struct variable **,
- const union value **,
- const union value *, const void *, int);
- /*
- Returns pointers to the variables used in the model.
- */
- int (*get_vars) (const void *, const struct variable **);
- struct variable *resid;
- struct variable *pred;
-
-};
-
-typedef struct pspp_linreg_cache_struct pspp_linreg_cache;