#include <yat/regression/OneDimensionalWeighted.h>
Public Member Functions | |
OneDimensionalWeighted (void) | |
virtual | ~OneDimensionalWeighted (void) |
virtual void | fit (const utility::VectorBase &x, const utility::VectorBase &y, const utility::VectorBase &w)=0 |
virtual double | predict (const double x) const =0 |
double | prediction_error2 (const double x, const double w=1.0) const |
double | r2 (void) const |
virtual double | s2 (double w=1) const =0 |
virtual double | standard_error2 (const double x) const =0 |
Protected Attributes | |
statistics::AveragerPairWeighted | ap_ |
double | chisq_ |
Chi-squared. |
theplu::yat::regression::OneDimensionalWeighted::OneDimensionalWeighted | ( | void | ) |
Default Constructor.
virtual theplu::yat::regression::OneDimensionalWeighted::~OneDimensionalWeighted | ( | void | ) | [virtual] |
Destructor
virtual void theplu::yat::regression::OneDimensionalWeighted::fit | ( | const utility::VectorBase & | x, | |
const utility::VectorBase & | y, | |||
const utility::VectorBase & | w | |||
) | [pure virtual] |
This function computes the best-fit given a model (see specific class for details) by minimizing , where is the fitted value. The weight should be proportional to the inverse of the variance for
Implemented in theplu::yat::regression::LinearWeighted, theplu::yat::regression::NaiveWeighted, and theplu::yat::regression::PolynomialWeighted.
virtual double theplu::yat::regression::OneDimensionalWeighted::predict | ( | const double | x | ) | const [pure virtual] |
Implemented in theplu::yat::regression::LinearWeighted, theplu::yat::regression::NaiveWeighted, and theplu::yat::regression::PolynomialWeighted.
double theplu::yat::regression::OneDimensionalWeighted::prediction_error2 | ( | const double | x, | |
const double | w = 1.0 | |||
) | const |
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 |
r2 is defined as or the fraction of the variance explained by the regression model.
virtual double theplu::yat::regression::OneDimensionalWeighted::s2 | ( | double | w = 1 |
) | const [pure virtual] |
is the estimation of variance of residuals or equivalently the conditional variance of Y.
Implemented in theplu::yat::regression::LinearWeighted, theplu::yat::regression::NaiveWeighted, and theplu::yat::regression::PolynomialWeighted.
virtual double theplu::yat::regression::OneDimensionalWeighted::standard_error2 | ( | const double | x | ) | const [pure virtual] |
The standard error is defined as
Implemented in theplu::yat::regression::LinearWeighted, theplu::yat::regression::NaiveWeighted, and theplu::yat::regression::PolynomialWeighted.
Averager for pair of x and y
double theplu::yat::regression::OneDimensionalWeighted::chisq_ [protected] |
Chi-squared.
Chi-squared is defined as the