yat
0.8.3pre
|
Polynomial Regression in weighted fashion. More...
#include <yat/regression/PolynomialWeighted.h>
Public Member Functions | |
PolynomialWeighted (size_t power) | |
~PolynomialWeighted (void) | |
Destructor. | |
void | fit (const utility::VectorBase &x, const utility::VectorBase &y, const utility::VectorBase &w) |
const utility::Vector & | fit_parameters (void) const |
double | s2 (const double w=1) const |
Mean Squared Error. | |
double | predict (const double x) 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. |
Polynomial Regression in weighted fashion.
theplu::yat::regression::PolynomialWeighted::PolynomialWeighted | ( | size_t | power | ) |
power | degree of polynomial model |
|
virtual |
This function computes the best-fit given the polynomial model model by minimizing , where is the fitted value. The weight should be proportional to the inverse of the variance for
Implements theplu::yat::regression::OneDimensionalWeighted.
const utility::Vector& theplu::yat::regression::PolynomialWeighted::fit_parameters | ( | void | ) | const |
|
virtual |
function predicting in one point.
Implements theplu::yat::regression::OneDimensionalWeighted.
|
inherited |
The prediction error is defined as expected squared deviation a new data point (with weight @a w) will be from the model value \form#214 and is typically divided into the conditional variance ( see s2() ) given \form#62 and the squared standard error ( see standard_error2() ) of the model estimation in \form#62.
@return expected prediction error for a new data point in @a x with weight @a w.
|
inherited |
r2 is defined as or the fraction of the variance explained by the regression model.
|
virtual |
Implements theplu::yat::regression::OneDimensionalWeighted.
|
protectedinherited |
Averager for pair of x and y
|
protectedinherited |
Chi-squared.
Chi-squared is defined as the