yat  0.10.4pre
Public Member Functions | Protected Attributes
theplu::yat::regression::PolynomialWeighted Class Reference

Polynomial Regression in weighted fashion. More...

#include </scratch/bob/jari/tmp/pristine/yat-0.10.x/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:
powerdegree 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::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 @a w) will be from the model
  value \form#211 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.

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

  @return expected prediction error for a new data point in @a x
  with weight @a 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.

double theplu::yat::regression::PolynomialWeighted::standard_error2 ( const double  x) const
virtual
Returns:
error of model value in x

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


Member Data Documentation

statistics::AveragerPairWeighted theplu::yat::regression::OneDimensionalWeighted::ap_
protectedinherited

Averager for pair of x and y

double theplu::yat::regression::OneDimensionalWeighted::chisq_
protectedinherited

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 Mon Nov 11 2013 09:41:45 for yat by  doxygen 1.8.1