Result of 1D Ordinary Least Squares regression (with or without intercept).
More...
#include <LinearRegression.hpp>
|
std::string | to_string () const |
| Formats the result as string.
|
|
Eigen::VectorXd | predict (Eigen::Ref< const Eigen::VectorXd > x) const |
| Predicts Y given X. More...
|
|
double | predict (double x) const |
| Predicts Y given X. More...
|
|
double | var_y () const |
| Estimated variance of observations Y, equal to rss / dof .
|
|
double | r2 () const |
| R2 coefficient. More...
|
|
double | adjusted_r2 () const |
| Adjusted R2 coefficient. More...
|
|
Result of 1D Ordinary Least Squares regression (with or without intercept).
The following members are calculated assuming independent Gaussian error terms:
◆ predict() [1/2]
Eigen::VectorXd ml::LinearRegression::UnivariateOLSResult::predict |
( |
Eigen::Ref< const Eigen::VectorXd > |
x | ) |
const |
Predicts Y given X.
- Parameters
-
x | Vector of independent variable values. |
- Returns
- Vector of predicted Y(X) with size
X.cols()
.
◆ predict() [2/2]
double ml::LinearRegression::UnivariateOLSResult::predict |
( |
double |
x | ) |
const |
|
inline |
Predicts Y given X.
- Parameters
-
x | Independent variable value. |
- Returns
- Predicted Y(X).
◆ slope
double ml::LinearRegression::UnivariateOLSResult::slope |
Coefficient multiplying X values when predicting Y.
◆ intercept
double ml::LinearRegression::UnivariateOLSResult::intercept |
Constant added to slope * X when predicting Y.
◆ var_slope
double ml::LinearRegression::UnivariateOLSResult::var_slope |
Estimated variance of the slope.
◆ var_intercept
double ml::LinearRegression::UnivariateOLSResult::var_intercept |
Estimated variance of the intercept.
◆ cov_slope_intercept
double ml::LinearRegression::UnivariateOLSResult::cov_slope_intercept |
Estimated covariance of the slope and the intercept.
The documentation for this struct was generated from the following file: