projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7706bdd
)
adjustments to prediction and residual arguments
author
Jason Stover
<jhs@math.gcsu.edu>
Sat, 8 Apr 2006 02:47:54 +0000
(
02:47
+0000)
committer
Jason Stover
<jhs@math.gcsu.edu>
Sat, 8 Apr 2006 02:47:54 +0000
(
02:47
+0000)
src/math/linreg/predict.c
patch
|
blob
|
history
diff --git
a/src/math/linreg/predict.c
b/src/math/linreg/predict.c
index fdd940972943c0d7a8b5b6d0f9777968f24641ec..a4bbcf9d676dbcb45fc4a439149d5c7aa9fc7a55 100644
(file)
--- a/
src/math/linreg/predict.c
+++ b/
src/math/linreg/predict.c
@@
-29,8
+29,8
@@
in the same order.
*/
double
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)
{
const pspp_linreg_cache *c,
int n_vals)
{
@@
-54,12
+54,13
@@
pspp_linreg_predict (const struct variable *predictors,
the caller passed us inadequate information, such as too
few or too many values.
*/
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++)
{
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;
}
}
result += tmp;
}
@@
-68,7
+69,7
@@
pspp_linreg_predict (const struct variable *predictors,
double
pspp_linreg_residual (const struct variable *predictors,
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)
const union value *obs,
const pspp_linreg_cache *c,
int n_vals)