structure for computation and storage of least squares linear regression results with model \(y = A + Bx\).
More...
|
| linear_model () |
| Default constructor.
|
|
template<typename Dataset1 , typename Dataset2 > |
| linear_model (const Dataset1 &X, const Dataset2 &Y) |
| Construct a linear model from data and compute the fit.
|
|
template<typename Dataset1 , typename Dataset2 > |
| linear_model (const Dataset1 &X, const Dataset2 &Y, real sigma_Y) |
| Construct a linear model from data and compute the fit.
|
|
template<typename Dataset1 , typename Dataset2 , typename Dataset3 > |
| linear_model (const Dataset1 &X, const Dataset2 &Y, const Dataset3 &sigma_Y) |
| Construct a linear model from data and compute the fit.
|
|
template<typename Dataset1 , typename Dataset2 > |
| linear_model (const Dataset1 &X, const Dataset2 &Y, real sigma_X, real sigma_Y) |
| Construct a linear model from data and compute the fit.
|
|
template<typename Dataset1 , typename Dataset2 > |
void | fit (const Dataset1 &X, const Dataset2 &Y) |
| Compute the linear regression of two sets of data of the same size using ordinary least squares linear regression. More...
|
|
template<typename Dataset1 , typename Dataset2 > |
void | fit (const Dataset1 &X, const Dataset2 &Y, real sigma_Y) |
| Compute the linear regression of two sets of data of the same size using ordinary least squares linear regression. More...
|
|
template<typename Dataset1 , typename Dataset2 , typename Dataset3 > |
void | fit (const Dataset1 &X, const Dataset2 &Y, const Dataset3 &sigma) |
| Compute the linear regression of two sets of data of the same size using least squares linear regression. More...
|
|
template<typename Dataset1 , typename Dataset2 > |
void | fit (const Dataset1 &X, const Dataset2 &Y, real sigma_X, real sigma_Y) |
| Compute the linear regression of two sets of data of the same size using least squares linear regression. More...
|
|
real | operator() (real x) |
| Compute the expected Y value for the given X value, following the computed model.
|
|
std::string | to_string () const |
| Convert the vector to string representation.
|
|
| operator std::string () |
| Convert the vector to string representation.
|
|
structure for computation and storage of least squares linear regression results with model \(y = A + Bx\).
template<typename Dataset1 , typename Dataset2 >
void theoretica::regression::linear_model::fit |
( |
const Dataset1 & |
X, |
|
|
const Dataset2 & |
Y |
|
) |
| |
|
inline |
Compute the linear regression of two sets of data of the same size using ordinary least squares linear regression.
Without the error on the y axis, the chi-squared and the error on the coefficients cannot be computed.
- Parameters
-
X | The set of values on the x axis |
Y | The set of values on the y axis |