#include <math/coefficient.h>
#include <math/linreg.h>
#include <math/coefficient.h>
-#include <math/covariance-matrix.h>
#include <math/design-matrix.h>
#include <src/data/category.h>
#include <src/data/variable.h>
only variables in the model are in the covariance matrix.
*/
static struct design_matrix *
-rearrange_covariance_matrix (const struct design_matrix *cov, pspp_linreg_cache *c)
+rearrange_covariance_matrix (const struct covariance_matrix *cm, pspp_linreg_cache *c)
{
const struct variable **model_vars;
+ struct design_matrix *cov;
struct design_matrix *result;
size_t *permutation;
size_t i;
size_t j;
size_t k;
+ assert (cm != NULL);
+ cov = covariance_to_design (cm);
assert (cov != NULL);
assert (c != NULL);
assert (cov->m->size1 > 0);
set CACHE->N_COEFFS.
*/
void
-pspp_linreg_with_cov (const struct design_matrix *full_cov,
+pspp_linreg_with_cov (const struct covariance_matrix *full_cov,
pspp_linreg_cache * cache)
{
struct design_matrix *cov;
cache_init (cache);
reg_sweep (cov->m);
post_sweep_computations (cache, cov, cov->m);
- covariance_matrix_destroy (cov);
+ design_matrix_destroy (cov);
}
#include <gsl/gsl_vector.h>
#include <gsl/gsl_matrix.h>
#include <src/math/coefficient.h>
+#include <math/covariance-matrix.h>
enum
{
/*
Regression using only the covariance matrix.
*/
-void pspp_linreg_with_cov (const struct design_matrix *, pspp_linreg_cache *);
+void pspp_linreg_with_cov (const struct covariance_matrix *, pspp_linreg_cache *);
#endif