theplu::yat::regression::PolynomialWeighted Class Reference

Polynomial Regression in weighted fashion. More...

#include <yat/regression/PolynomialWeighted.h>

Inheritance diagram for theplu::yat::regression::PolynomialWeighted:

theplu::yat::regression::OneDimensionalWeighted

List of all members.

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::Vectorfit_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.


Detailed Description

Polynomial Regression in weighted fashion.

Constructor & Destructor Documentation

theplu::yat::regression::PolynomialWeighted::PolynomialWeighted ( size_t  power  ) 

Parameters:
power degree of polynomial model


Member Function Documentation

void theplu::yat::regression::PolynomialWeighted::fit ( const utility::VectorBase x,
const utility::VectorBase y,
const utility::VectorBase w 
) [virtual]

This function computes the best-fit given the polynomial model model by minimizing $ \sum{w_i(\hat{y_i}-y_i)^2} $, where $ \hat{y} $ is the fitted value. The weight $ w_i $ should be proportional to the inverse of the variance for $ /// y_i $

Implements theplu::yat::regression::OneDimensionalWeighted.

const utility::Vector& theplu::yat::regression::PolynomialWeighted::fit_parameters ( void   )  const

Returns:
parameters of the model
See also:
MultiDimensional

double theplu::yat::regression::PolynomialWeighted::predict ( const double  x  )  const [virtual]

function predicting in one point.

Implements theplu::yat::regression::OneDimensionalWeighted.

double theplu::yat::regression::PolynomialWeighted::standard_error2 ( const double  x  )  const [virtual]

Returns:
error of model value in x

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 $ E((Y|x - \hat{y}(x))^2|w) $ and is typically divided into the conditional variance ( see s2() ) given $ x $ and the squared standard error ( see standard_error2() ) of the model estimation in $ x $.

$ E((Y|x - E(Y|x))^2|w) + E((E(Y|x) - \hat{y}(x))^2) $

Returns:
expected prediction error for a new data point in x with weight w.

double theplu::yat::regression::OneDimensionalWeighted::r2 ( void   )  const [inherited]

r2 is defined as $ \frac{\sum w_i(y_i-\hat{y}_i)^2}{\sum w_i(y_i-m_y)^2} $ or the fraction of the variance explained by the regression model.


Member Data Documentation

Averager for pair of x and y

Chi-squared.

Chi-squared is defined as the $ \sum{w_i(\hat{y_i}-y_i)^2} $


The documentation for this class was generated from the following file:

Generated on Tue Jan 18 02:20:10 2011 for yat by  doxygen 1.5.5