X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Flinreg%2Fpspp_linreg.h;h=a8db8a10f8e7979302fa401394e53088239b55d6;hb=4f979f136b4ad72bbb79aa801f33b183f0f44166;hp=5fa4e63bc45c06c4166e741bb5e6f9c01825bea0;hpb=7ca2a9077640efaa6da449396972180684e49243;p=pspp-builds.git diff --git a/lib/linreg/pspp_linreg.h b/lib/linreg/pspp_linreg.h index 5fa4e63b..a8db8a10 100644 --- a/lib/linreg/pspp_linreg.h +++ b/lib/linreg/pspp_linreg.h @@ -63,24 +63,36 @@ enum /* Cache for the relevant data from the model. There are several - members which the caller may not use, and which could use a lot of + members which the caller might not use, and which could use a lot of storage. Therefore non-essential members of the struct will be allocated only when requested. */ +struct pspp_linreg_coeff +{ + double estimate; /* Estimated coefficient. */ + const struct variable *v; /* The variable associated with this coefficient. + The calling function should supply the variable + when it creates the design matrix. The estimation + procedure ignores the struct variable *. It is here so + the caller can match parameters with relevant + variables. + */ +}; struct pspp_linreg_cache_struct { int n_obs; /* Number of observations. */ int n_indeps; /* Number of independent variables. */ + int n_coeffs; /* - The var structs are ignored during estimation. - They are here so the calling procedures can - find the variables used in the model. + The variable struct is ignored during estimation. + It is here so the calling procedure can + find the variable used in the model. */ - struct var *depvar; - struct var **indepvar; + const struct variable *depvar; + gsl_vector *residuals; - gsl_vector *param_estimates; + struct pspp_linreg_coeff *coeff; int method; /* Method to use to estimate parameters. */ /* Means and standard deviations of the variables.