|
A library for working with phylogenetic and population genetic data.
v0.27.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_UTILS_MATH_REGRESSION_GLM_H_
2 #define GENESIS_UTILS_MATH_REGRESSION_GLM_H_
167 std::vector<double>
const& y_response,
171 GlmControl
const& control = {}
183 Matrix<double>
const& x_predictors,
184 std::vector<double>
const& y_response,
185 GlmFamily
const& family,
186 GlmExtras
const& extras = {},
187 GlmControl
const& control = {}
197 Matrix<double>
const& x_predictors,
198 std::vector<double>
const& y_response,
199 GlmExtras
const& extras = {},
200 GlmControl
const& control = {}
206 #endif // include guard
size_t rank
Rank of X after regression on strata.
double scale
Scale factor (scalar).
size_t max_iterations
Maximum number of iterations to run the IRLS algorithm for (if needed).
GlmOutput glm_fit(Matrix< double > const &x_predictors, std::vector< double > const &y_response, GlmFamily const &family, GlmLink const &link, GlmExtras const &extras, GlmControl const &control)
Fit a Generalized Linear Model (GLM).
Matrix< double > Xb
Orthogonal basis for X space (N * M matrix, with N * rank being used).
std::vector< double > tri
Upper unit triangular transformation matrix, with Xb - tr.Xb placed in the diagonal (size (M * (M+1))...
std::vector< double > weights
Weights (size N)
double max_r2
Threshold for singluarities. Internally used as eta = 1.0 - max_r2.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
double epsilon
Proportional change in weighted sum of squares residuals to declare convergence between two iteration...
size_t df_resid
Residual degrees of freedom.
std::vector< double > which
Which columns in the X matrix were estimated (first = 0) (size M).
std::vector< double > fitted
Fitted values (size N).
std::vector< double > betaQ
Vector of parameter estimates (in terms of basis matrix, Xb) (size M).
std::vector< double > resid
Working residuals (on linear predictor scale) (size N).