40 |
#include "var.h" |
#include "var.h" |
41 |
#include "vfm.h" |
#include "vfm.h" |
42 |
|
|
43 |
|
#define REG_LARGE_DATA 1000 |
44 |
|
|
45 |
/* (headers) */ |
/* (headers) */ |
46 |
|
|
47 |
|
|
646 |
(const struct variable *) design_matrix_col_to_var (X, i); |
(const struct variable *) design_matrix_col_to_var (X, i); |
647 |
assert (lcache->coeff[j].v != NULL); |
assert (lcache->coeff[j].v != NULL); |
648 |
} |
} |
649 |
|
/* |
650 |
|
For large data sets, use QR decomposition. |
651 |
|
*/ |
652 |
|
if (n_data > sqrt (n_indep) && n_data > REG_LARGE_DATA) |
653 |
|
{ |
654 |
|
lcache->method = PSPP_LINREG_SVD; |
655 |
|
} |
656 |
/* |
/* |
657 |
Find the least-squares estimates and other statistics. |
Find the least-squares estimates and other statistics. |
658 |
*/ |
*/ |
659 |
pspp_linreg ((const gsl_vector *) Y, X->m, &lopts, lcache); |
pspp_linreg ((const gsl_vector *) Y, X->m, &lopts, lcache); |
660 |
subcommand_statistics (cmd.a_statistics, lcache); |
subcommand_statistics (cmd.a_statistics, lcache); |
661 |
gsl_vector_free (Y); |
gsl_vector_free (Y); |
662 |
design_matrix_destroy (X); |
design_matrix_destroy (X); |