From: Jason Stover Date: Mon, 28 Nov 2005 02:37:26 +0000 (+0000) Subject: QR decomposition for large data sets X-Git-Tag: v0.6.0~1130 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38f15c503b7122d4ff1a58950045a31c537a354f;p=pspp-builds.git QR decomposition for large data sets --- diff --git a/src/regression.q b/src/regression.q index 02a675f7..30224a62 100644 --- a/src/regression.q +++ b/src/regression.q @@ -40,6 +40,8 @@ #include "var.h" #include "vfm.h" +#define REG_LARGE_DATA 1000 + /* (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); } + /* + 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. */ - 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);