/* PSPP - a program for statistical analysis.
- Copyright (C) 2005, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2010, 2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
size_t i;
size_t j;
int rc;
-
+
assert (sw != NULL);
assert (l != NULL);
Get the covariance matrix of the parameter estimates.
Only the upper triangle is necessary.
*/
-
+
/*
The loops below do not compute the entries related
to the estimated intercept.
xm = gsl_matrix_calloc (1, l->n_indeps);
for (i = 0; i < xm->size2; i++)
{
- gsl_matrix_set (xm, 0, i,
+ gsl_matrix_set (xm, 0, i,
linreg_get_indep_variable_mean (l, i));
}
rc = gsl_blas_dsymm (CblasRight, CblasUpper, l->mse,
* linreg_get_indep_variable_mean (l, i - 1);
}
gsl_matrix_set (l->cov, 0, 0, tmp);
-
+
l->intercept = m;
}
else
__FILE__, __LINE__, gsl_strerror (rc));
exit (rc);
}
-}
+}
/*
Predict the value of the dependent variable with the new set of
/* Covariances related to the intercept. */
intercept_variance += linreg_mse (l) / linreg_n_obs (l);
- gsl_matrix_set (l->cov, 0, 0, intercept_variance);
+ gsl_matrix_set (l->cov, 0, 0, intercept_variance);
for (i = 0; i < q->size1; i++)
{
for (j = 0; j < q->size2; j++)
{
- intcpt_coef -= gsl_matrix_get (q, i, j)
+ intcpt_coef -= gsl_matrix_get (q, i, j)
* linreg_get_indep_variable_mean (l, j);
}
gsl_matrix_set (l->cov, 0, i + 1, intcpt_coef);
gsl_matrix_set (l->cov, i + 1, 0, intcpt_coef);
intcpt_coef = 0.0;
}
-
+
gsl_matrix_free (q);
gsl_matrix_free (r);
gsl_vector_free (xty);
params = gsl_matrix_calloc (cov->size1, cov->size2);
gsl_matrix_memcpy (params, cov);
reg_sweep (params, l->dependent_column);
- post_sweep_computations (l, params);
+ post_sweep_computations (l, params);
gsl_matrix_free (params);
}
else if (l->method == LINREG_QR)
return c->cov;
}
-double
+double
linreg_coeff (const linreg *c, size_t i)
{
return (c->coeff[i]);
return (c->indep_vars[i]);
}
-size_t
+size_t
linreg_n_coeffs (const linreg *c)
{
return c->n_coeffs;
return c->sst;
}
-double
+double
linreg_dfmodel ( const linreg *c)
{
return c->dfm;
c->depvar_mean = x;
}
-double
+double
linreg_get_depvar_mean (const linreg *c)
{
return c->depvar_mean;