#include <polynomialRegression.hpp>
Public Member Functions | |
PolynomialRegression () | |
constructor More... | |
PolynomialRegression (int order) | |
constructor More... | |
void | estimate (const std::vector< double > &x, const std::vector< double > &y) |
estimates the parameters basing on provided data More... | |
void | estimate (const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &w) |
weighted estimates the parameters basing on provided data More... | |
std::vector< double > | getCoefficient () const |
return coefficients of the regression More... | |
double | operator() (double) const |
evaluates the linear regression model for x More... | |
Public Member Functions inherited from julian::DeeplyCopyableRegression< PolynomialRegression > | |
virtual Regression * | clone () const |
virtual copy constructor More... | |
Public Member Functions inherited from julian::Regression | |
Regression () | |
Constructor. More... | |
virtual | ~Regression () |
Destructor. More... | |
Private Attributes | |
int | order_ |
Order of polynomial. More... | |
std::vector< double > | coefs_ |
Vector of coefficients. More... | |
Detailed Description
Polynomial regression is regression model with a single explanatory variable. The parameters of the regression are calculated by minimizing the OLS. In other words class computes the best-fit linear regression coefficients of the model for the dataset (x, y) by minimizing the sum: .
For more information see Wikipedia
- Remarks
- Class uses algorithm implemented in GSL
Constructor & Destructor Documentation
|
inline |
constructor
- Note
- If order of polynomial is not given, order of polynomial is set to 2.
|
inline |
constructor
- Parameters
-
order Order of polynomial fitted
Member Function Documentation
|
virtual |
estimates the parameters basing on provided data
Implements julian::Regression.
void julian::PolynomialRegression::estimate | ( | const std::vector< double > & | x, |
const std::vector< double > & | y, | ||
const std::vector< double > & | w | ||
) |
weighted estimates the parameters basing on provided data
|
virtual |
return coefficients of the regression
The i-th term of vector represents coefficient of i-th power of x
Implements julian::Regression.
|
virtual |
evaluates the linear regression model for x
Implements julian::Regression.
Member Data Documentation
|
private |
Vector of coefficients.
|
private |
Order of polynomial.
The documentation for this class was generated from the following files:
- C:/Unix/home/OEM/jULIAN/src/mathematics/regressions/polynomialRegression.hpp
- C:/Unix/home/OEM/jULIAN/src/mathematics/regressions/polynomialRegression.cpp