pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/src/math/linreg predict.c


From: Jason H Stover
Subject: [Pspp-cvs] pspp/src/math/linreg predict.c
Date: Sat, 08 Apr 2006 02:47:54 +0000

CVSROOT:        /sources/pspp
Module name:    pspp
Branch:         
Changes by:     Jason H Stover <address@hidden> 06/04/08 02:47:54

Modified files:
        src/math/linreg: predict.c 

Log message:
        adjustments to prediction and residual arguments

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/math/linreg/predict.c.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: pspp/src/math/linreg/predict.c
diff -u pspp/src/math/linreg/predict.c:1.2 pspp/src/math/linreg/predict.c:1.3
--- pspp/src/math/linreg/predict.c:1.2  Fri Apr  7 19:37:13 2006
+++ pspp/src/math/linreg/predict.c      Sat Apr  8 02:47:54 2006
@@ -29,8 +29,8 @@
   in the same order.
  */
 double
-pspp_linreg_predict (const struct variable *predictors, 
-                    const union value *vals, 
+pspp_linreg_predict (const struct variable **predictors, 
+                    const union value **vals, 
                     const pspp_linreg_cache *c,
                     int n_vals)
 {
@@ -54,12 +54,13 @@
     the caller passed us inadequate information, such as too
     few or too many values.
    */
+  n_vals++;
   for (i = 1; i < c->n_coeffs && i < n_vals; i++)
     {
-      tmp = pspp_linreg_coeff_get_est (pspp_linreg_get_coeff (c, predictors + 
i, vals + i));
-      if ((predictors + i)->type == NUMERIC)
+      tmp = pspp_linreg_coeff_get_est (pspp_linreg_get_coeff (c, 
predictors[i], vals[i]));
+      if (predictors[i]->type == NUMERIC)
        {
-         tmp *= (vals + i)->f;
+         tmp *= vals[i]->f;
        }
       result += tmp;
     }
@@ -68,7 +69,7 @@
 
 double
 pspp_linreg_residual (const struct variable *predictors,
-                     const union value *vals,
+                     const union value **vals,
                      const union value *obs,
                      const pspp_linreg_cache *c,
                      int n_vals)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]