yat
0.8.3pre
|
linear regression. More...
#include <yat/regression/Linear.h>
Public Member Functions | |
Linear (void) | |
The default constructor. | |
virtual | ~Linear (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) |
double | predict (const double x) const |
double | s2 (void) const |
double | standard_error2 (const double x) const |
double | chisq (void) const |
Chi-squared. | |
double | prediction_error2 (const double x) const |
std::ostream & | print (std::ostream &os, const double min, double max, const unsigned int n) const |
print output to ostream os | |
double | r2 (void) const |
Protected Member Functions | |
double | variance (void) const |
Protected Attributes | |
statistics::AveragerPair | ap_ |
double | chisq_ |
linear regression.
Data are modeled as .
double theplu::yat::regression::Linear::alpha | ( | void | ) | const |
The parameter is estimated as
double theplu::yat::regression::Linear::alpha_var | ( | void | ) | const |
The variance is estimated as where
double theplu::yat::regression::Linear::beta | ( | void | ) | const |
The parameter is estimated as
double theplu::yat::regression::Linear::beta_var | ( | void | ) | const |
The variance is estimated as where
|
inherited |
Chi-squared.
Chi-squared is defined as the
|
virtual |
Model is fitted by minimizing . By construction and are independent.
Implements theplu::yat::regression::OneDimensional.
|
virtual |
Implements theplu::yat::regression::OneDimensional.
|
inherited |
The prediction error is defined as the expected squared deviation a new data point will have from value the model provides: and is typically divided into the conditional variance ( see s2() ) given and the squared standard error ( see standard_error2() ) of the model estimation in .
|
inherited |
print output to ostream os
Printing estimated model to os in the points defined by min, max, and n. The values printed for each point is the x-value, the estimated y-value, and the estimated standard deviation of a new data poiunt will have from the y-value given the x-value (see prediction_error()).
os | Ostream printout is sent to |
n | number of points printed |
min | smallest x-value for which the model is printed |
max | largest x-value for which the model is printed |
|
inherited |
r2 is defined as or the fraction of the variance explained by the regression model.
|
virtual |
|
virtual |
The error of the model is estimated as
Implements theplu::yat::regression::OneDimensional.
|
protectedinherited |
Variance of y
|
protectedinherited |
Averager for pair of x and y
|
protectedinherited |