yat
0.15.2pre
|
#include <yat/regression/NegativeBinomial.h>
Public Member Functions | |
double | alpha (void) const |
alpha parameter More... | |
const utility::Matrix & | covariance (void) const |
Covariance of parameters. More... | |
void | fit (const utility::Matrix &x, const utility::VectorBase &y) |
fit model parameters More... | |
const utility::Vector & | fit_parameters (void) const |
double | predict (const utility::VectorBase &x) const |
Negative Binomial regression models count data from a negative binomial distribution, , for which the mean is is modeled as and the variance where is the dispersion parameter describing how wider the distribution is compared to Poisson; for the models equals Poisson regression.
double theplu::yat::regression::NegativeBinomial::alpha | ( | void | ) | const |
alpha parameter
The alpha parameter describves the dispersion of the data. Greater alpha implies greater dispersion and unity alpha means the model is same as Poisson regression.
const utility::Matrix& theplu::yat::regression::NegativeBinomial::covariance | ( | void | ) | const |
Covariance of parameters.
Covariance matrix is inferred as where is a diagonal matrix with element
void theplu::yat::regression::NegativeBinomial::fit | ( | const utility::Matrix & | x, |
const utility::VectorBase & | y | ||
) |
fit model parameters
The parameters are tuned to minimise deviation between data and model
const utility::Vector& theplu::yat::regression::NegativeBinomial::fit_parameters | ( | void | ) | const |
double theplu::yat::regression::NegativeBinomial::predict | ( | const utility::VectorBase & | x | ) | const |
Predicted value given x. The prediction is calculated as