X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Flinreg%2Fcoefficient.h;h=c2c7200c751a7a45edbc311f50bbbfc1323b7935;hb=7102dc8607b7e6e25bdb9806f508dce71fe76ce4;hp=a82b54200f88e03a11df9c1319118b3ae7be2c39;hpb=a19b858e0ac3c69e4a28c0ca6d8674427268a863;p=pspp diff --git a/src/math/linreg/coefficient.h b/src/math/linreg/coefficient.h index a82b54200f..c2c7200c75 100644 --- a/src/math/linreg/coefficient.h +++ b/src/math/linreg/coefficient.h @@ -23,8 +23,10 @@ #ifndef COEFFICIENT_H #define COEFFICIENT_H - +#include #include +#include +#include struct design_matrix; @@ -63,42 +65,57 @@ struct pspp_linreg_coeff Accessor functions for matching coefficients and variables. */ -void pspp_linreg_coeff_free (struct pspp_linreg_coeff *c); +void pspp_linreg_coeff_free (struct pspp_linreg_coeff *); /* Initialize the variable and value pointers inside the coefficient structures for the linear model. */ void -pspp_linreg_coeff_init (pspp_linreg_cache *c, - struct design_matrix *X); +pspp_linreg_coeff_init (pspp_linreg_cache *, + struct design_matrix *); void -pspp_linreg_coeff_set_estimate (struct pspp_linreg_coeff *c, +pspp_linreg_coeff_set_estimate (struct pspp_linreg_coeff *, double estimate); void -pspp_linreg_coeff_set_std_err (struct pspp_linreg_coeff *c, +pspp_linreg_coeff_set_std_err (struct pspp_linreg_coeff *, double std_err); +/* + Return the estimated value of the coefficient. + */ +double +pspp_linreg_coeff_get_est (const struct pspp_linreg_coeff *); + +/* + Return the standard error of the estimated coefficient. +*/ +double +pspp_linreg_coeff_get_std_err (const struct pspp_linreg_coeff *); + /* How many variables are associated with this coefficient? */ int -pspp_linreg_coeff_get_n_vars (struct pspp_linreg_coeff *c); +pspp_linreg_coeff_get_n_vars (struct pspp_linreg_coeff *); /* Which variable does this coefficient match? */ const struct variable * -pspp_linreg_coeff_get_var (struct pspp_linreg_coeff *c, int i); +pspp_linreg_coeff_get_var (struct pspp_linreg_coeff *, int ); /* Which value is associated with this coefficient/variable comination? */ const union value * -pspp_linreg_coeff_get_value (struct pspp_linreg_coeff *c, - const struct variable *v); - +pspp_linreg_coeff_get_value (struct pspp_linreg_coeff *, + const struct variable *); +const struct pspp_linreg_coeff * +pspp_linreg_get_coeff (const pspp_linreg_cache *, + const struct variable *, + const union value *); #endif