projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9987b8c
)
QR decomposition for large data sets
author
Jason Stover
<jhs@math.gcsu.edu>
Mon, 28 Nov 2005 02:37:26 +0000
(
02:37
+0000)
committer
Jason Stover
<jhs@math.gcsu.edu>
Mon, 28 Nov 2005 02:37:26 +0000
(
02:37
+0000)
src/regression.q
patch
|
blob
|
history
diff --git
a/src/regression.q
b/src/regression.q
index 02a675f74293cb04d11b9e95cb68b7b61f8472d2..30224a6263e46fcf42c62c9facf33ab23f5d9c0f 100644
(file)
--- a/
src/regression.q
+++ b/
src/regression.q
@@
-40,6
+40,8
@@
#include "var.h"
#include "vfm.h"
#include "var.h"
#include "vfm.h"
+#define REG_LARGE_DATA 1000
+
/* (headers) */
/* (headers) */
@@
-644,10
+646,17
@@
run_regression (const struct casefile *cf, void *cmd_ UNUSED)
(const struct variable *) design_matrix_col_to_var (X, i);
assert (lcache->coeff[j].v != NULL);
}
(const struct variable *) design_matrix_col_to_var (X, i);
assert (lcache->coeff[j].v != NULL);
}
+ /*
+ For large data sets, use QR decomposition.
+ */
+ if (n_data > sqrt (n_indep) && n_data > REG_LARGE_DATA)
+ {
+ lcache->method = PSPP_LINREG_SVD;
+ }
/*
Find the least-squares estimates and other statistics.
*/
/*
Find the least-squares estimates and other statistics.
*/
- pspp_linreg ((const gsl_vector *) Y, X->m, &lopts, lcache);
+
pspp_linreg ((const gsl_vector *) Y, X->m, &lopts, lcache);
subcommand_statistics (cmd.a_statistics, lcache);
gsl_vector_free (Y);
design_matrix_destroy (X);
subcommand_statistics (cmd.a_statistics, lcache);
gsl_vector_free (Y);
design_matrix_destroy (X);