Theoretica
A C++ numerical and automatic mathematical library
|
Regression to a model. More...
Classes | |
class | linear_model |
structure for computation and storage of least squares linear regression results with model \(y = A + Bx\). More... | |
Functions | |
template<typename Dataset1 , typename Dataset2 > | |
void | ols_linear (const Dataset1 &X, const Dataset2 &Y, real &intercept, real &slope) |
Compute the coefficients of the linear regression using Ordinary Least Squares. | |
template<typename Dataset1 , typename Dataset2 > | |
void | ols_linear (const Dataset1 &X, const Dataset2 &Y, real sigma_Y, real &intercept, real &slope, real &sigma_A, real &sigma_B) |
Compute the coefficients of the linear regression using Ordinary Least Squares. | |
template<typename Dataset1 , typename Dataset2 > | |
void | ols_linear (const Dataset1 &X, const Dataset2 &Y, real sigma_Y, real &intercept, real &slope, mat2 &covar_mat) |
Compute the coefficients of the linear regression using Ordinary Least Squares. | |
template<typename Dataset1 , typename Dataset2 , typename Dataset3 > | |
void | wls_linear (const Dataset1 &X, const Dataset2 &Y, const Dataset3 &W, real &intercept, real &slope, mat2 &covar_mat) |
Compute the coefficients of the linear regression using Weighted Least Squares. | |
template<typename Dataset1 , typename Dataset2 > | |
void | wls_linear (const Dataset1 &X, const Dataset2 &Y, real sigma_X, real sigma_Y, real &intercept, real &slope, mat2 &covar_mat) |
Compute the coefficients of the linear regression using Weighted Least Squares. | |
template<typename Dataset1 , typename Dataset2 > | |
void | ols_linear_orig (const Dataset1 &X, const Dataset2 &Y, real sigma_Y, real &B, real &sigma_B) |
Compute the Ordinary Least Squares regression to a line passing through the origin. | |
template<typename Dataset1 , typename Dataset2 , typename Dataset3 > | |
void | wls_linear_orig (const Dataset1 &X, const Dataset2 &Y, const Dataset3 &W, real &B, real &sigma_B) |
Compute the Weight Least Squares regression to a line passing through the origin. | |
template<typename Dataset1 , typename Dataset2 > | |
real | ols_linear_error (const Dataset1 &X, const Dataset2 &Y, real intercept, real slope) |
Compute the error of the least squares linear regression from the X and Y datasets. | |
template<typename Dataset1 , typename Dataset2 > | |
real | ols_linear_intercept (const Dataset1 &X, const Dataset2 &Y) |
Compute the intercept of the least squares linear regression from X and Y. | |
template<typename Dataset1 , typename Dataset2 > | |
real | ols_linear_sigma_A (const Dataset1 &X, const Dataset2 &Y, real sigma_y) |
Compute the error on the intercept (A) | |
template<typename Dataset1 , typename Dataset2 > | |
real | ols_linear_slope (const Dataset1 &X, const Dataset2 &Y) |
Compute the slope of the least squares linear regression from X and Y. | |
template<typename Dataset1 , typename Dataset2 > | |
real | ols_linear_sigma_B (const Dataset1 &X, const Dataset2 &Y, real sigma_y) |
Compute the error on the slope coefficient (B) | |
template<typename Dataset1 , typename Dataset2 , typename Dataset3 > | |
real | wls_linear_intercept (const Dataset1 &X, const Dataset2 &Y, const Dataset3 &W) |
Compute the intercept of the weighted least squares linear regression from X and Y. | |
template<typename Dataset1 , typename Dataset2 , typename Dataset3 > | |
real | wls_linear_slope (const Dataset1 &X, const Dataset2 &Y, const Dataset3 &W) |
Compute the slope of the weighted least squares linear regression from X and Y. | |
Regression to a model.