#include <yat/regression/LinearWeighted.h>
Public Member Functions | |
LinearWeighted (void) | |
The default constructor. | |
virtual | ~LinearWeighted (void) |
The destructor. | |
double | alpha (void) const |
double | alpha_var (void) const |
double | beta (void) const |
double | beta_var (void) const |
void | fit (const utility::VectorBase &x, const utility::VectorBase &y, const utility::VectorBase &w) |
double | predict (const double x) const |
double | s2 (double w=1) const |
double | standard_error2 (const double x) const |
double | prediction_error2 (const double x, const double w=1.0) const |
double | r2 (void) const |
Protected Attributes | |
statistics::AveragerPairWeighted | ap_ |
double | chisq_ |
Chi-squared. |
double theplu::yat::regression::LinearWeighted::alpha | ( | void | ) | const |
is estimated as
double theplu::yat::regression::LinearWeighted::alpha_var | ( | void | ) | const |
double theplu::yat::regression::LinearWeighted::beta | ( | void | ) | const |
is estimated as
double theplu::yat::regression::LinearWeighted::beta_var | ( | void | ) | const |
void theplu::yat::regression::LinearWeighted::fit | ( | const utility::VectorBase & | x, | |
const utility::VectorBase & | y, | |||
const utility::VectorBase & | w | |||
) | [virtual] |
This function computes the best-fit linear regression coefficients of the model from vectors x and y, by minimizing , where is the weighted average. By construction and are independent.
Implements theplu::yat::regression::OneDimensionalWeighted.
double theplu::yat::regression::LinearWeighted::predict | ( | const double | x | ) | const [virtual] |
Function predicting value using the linear model:
Implements theplu::yat::regression::OneDimensionalWeighted.
double theplu::yat::regression::OneDimensionalWeighted::prediction_error2 | ( | const double | x, | |
const double | w = 1.0 | |||
) | const [inherited] |
The prediction error is defined as expected squared deviation a new data point (with weight w) will be from the model value and is typically divided into the conditional variance ( see s2() ) given and the squared standard error ( see standard_error2() ) of the model estimation in .
double theplu::yat::regression::OneDimensionalWeighted::r2 | ( | void | ) | const [inherited] |
r2 is defined as or the fraction of the variance explained by the regression model.
double theplu::yat::regression::LinearWeighted::s2 | ( | double | w = 1 |
) | const [virtual] |
Noise level for points with weight w.
Implements theplu::yat::regression::OneDimensionalWeighted.
double theplu::yat::regression::LinearWeighted::standard_error2 | ( | const double | x | ) | const [virtual] |
estimated error .
Implements theplu::yat::regression::OneDimensionalWeighted.
statistics::AveragerPairWeighted theplu::yat::regression::OneDimensionalWeighted::ap_ [protected, inherited] |
Averager for pair of x and y
double theplu::yat::regression::OneDimensionalWeighted::chisq_ [protected, inherited] |
Chi-squared.
Chi-squared is defined as the