Result of multivariate Ordinary Least Squares regression.
More...
#include <LinearRegression.hpp>
|
std::string | to_string () const |
| Formats the result as string.
|
|
Eigen::VectorXd | predict (Eigen::Ref< const Eigen::MatrixXd > X) const |
| Predicts Y given X. More...
|
|
double | predict_single (Eigen::Ref< const Eigen::VectorXd > 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...
|
|
|
Eigen::VectorXd | beta |
|
Eigen::MatrixXd | cov |
|
unsigned int | n |
|
unsigned int | dof |
|
double | rss |
|
double | tss |
|
Result of multivariate Ordinary Least Squares regression.
The cov matrix is calculated asuming independent Gaussian error terms.
◆ predict()
Eigen::VectorXd ml::LinearRegression::MultivariateOLSResult::predict |
( |
Eigen::Ref< const Eigen::MatrixXd > |
X | ) |
const |
Predicts Y given X.
- Parameters
-
X | Matrix of independent variables with data points in columns. |
- Returns
- Vector of predicted Y(X) with size
X.cols()
.
- Exceptions
-
std::invalid_argument | If X.rows() != beta.size() . |
◆ predict_single()
double ml::LinearRegression::MultivariateOLSResult::predict_single |
( |
Eigen::Ref< const Eigen::VectorXd > |
x | ) |
const |
Predicts Y given X.
- Parameters
-
x | Vector of independent variables. |
- Returns
- Predicted Y(X).
- Exceptions
-
std::invalid_argument | If X.size() != beta.size() . |
◆ beta
Eigen::VectorXd ml::LinearRegression::MultivariateOLSResult::beta |
Fitted coefficients of the model \(\hat{y} = \vec{\beta} \cdot \vec{x}\).
◆ cov
Eigen::MatrixXd ml::LinearRegression::MultivariateOLSResult::cov |
Covariance matrix of beta coefficients.
The documentation for this struct was generated from the following file: