Expand description
§solow-regression
Linear regression models estimated by least squares, with the full standard battery of results and inference statistics. Validated against an authoritative reference.
use ndarray::{array, Array1};
use solow_core::tools::{add_constant, HasConstant};
use solow_regression::LinearModel;
let x = array![[1.0], [2.0], [3.0], [4.0], [5.0]];
let y: Array1<f64> = array![1.1, 1.9, 3.2, 3.9, 5.1];
let design = add_constant(&x, true, HasConstant::Add).unwrap();
let res = LinearModel::ols(y, design).unwrap().fit().unwrap();
assert!((res.rsquared - 0.997).abs() < 0.01);Structs§
- ARDRegression
- Fitted ARDRegression — Automatic Relevance Determination.
- Bayesian
Ridge - Fitted BayesianRidge.
- Dummy
Classifier - Fitted DummyClassifier.
- Dummy
Regressor - Fitted DummyRegressor.
- Elastic
Net - Elastic-net penalised linear regression by coordinate descent.
- Elastic
NetCV - Cross-validated ElasticNet with a 2-D
(alpha, l1_ratio)grid. - Glsar
- A linear regression model with AR(p) autoregressive errors, estimated by iterative feasible GLS.
- Glsar
Results - The fitted result of a
Glsarmodel. - Huber
Regressor - Fitted Huber regressor.
- Kernel
Ridge - Kernel ridge regression — the closed-form dual solution
α = (K + λI)⁻¹ y, predicting viaf(x) = Σᵢ αᵢ · k(xᵢ, x). - Lars
- Fitted Lars.
- Lasso
- L¹-penalised linear regression by coordinate descent.
- LassoCV
- Cross-validated Lasso.
- Lasso
Lars - LassoLars — L1-regularised path of Lars (Efron-Hastie-Johnstone-
Tibshirani 2004, §7). For simplicity we return the Lars solution
with a caller-specified L1 penalty enforced via early-stopping when
the maximum correlation drops below
alpha. - Lasso
LarsIC - Fitted
LassoLarsIC. - Linear
Model - A linear regression model awaiting estimation.
- Linear
Results - The fitted result of a
LinearModel, holding every standard quantity. - Multi
Task Elastic Net - Fitted MultiTaskElasticNet.
- Multi
Task Lasso - Fitted MultiTaskLasso.
- Orthogonal
Matching Pursuit - OrthogonalMatchingPursuit — greedy sparse regression that adds one
atom per iteration until either
n_nonzero_coefsare selected or the residual norm drops belowtol. - Passive
Aggressive Classifier - PassiveAggressiveClassifier — margin-based online classifier (Crammer et al. 2006).
- Passive
Aggressive Regressor - PassiveAggressiveRegressor — ε-insensitive PA variant.
- Perceptron
- Perceptron — a special case of SGDClassifier with the perceptron loss.
- Quant
Reg - A quantile-regression model awaiting a
fit(q). - Quant
RegResults - The fitted result of a
QuantReg. - Ransac
Regressor - Fitted RANSAC regressor.
- RecursiveLS
- A recursive-least-squares model awaiting
fit. - RecursiveLS
Results - The fitted result of a
RecursiveLS. - Ridge
- L²-penalised linear regression.
- RidgeCV
- Cross-validated Ridge regression.
- Ridge
Classifier - Fitted RidgeClassifier.
- Ridge
ClassifierCV - Fitted RidgeClassifierCV.
- RollingOLS
- A rolling-window OLS model awaiting
fit. - RollingOLS
Results - The fitted result of a
RollingOLS. - SgdClassifier
- Fitted SGDClassifier (binary,
y ∈ {-1, +1}). - SgdRegressor
- Fitted SGDRegressor.
- SirResults
- The fitted result of a
SlicedInverseRegmodel. - Sliced
Inverse Reg - A Sliced Inverse Regression model awaiting estimation.
- Theil
SenRegressor - Fitted TheilSen regressor (median-based linear model).
Enums§
- CovType
- The kind of robust covariance to compute.
- Dummy
Classifier Strategy - DummyClassifier strategy.
- Dummy
Regressor Strategy - DummyRegressor strategy.
- Information
Criterion - Information criterion used for model selection.
- Ridge
Kernel - Kernel choice for
KernelRidge. - SgdLoss
- Loss function for SGD.
- SgdPenalty
- Regularisation penalty.
Functions§
- bse_
from_ cov - Standard errors
√diag(cov)from a covariance matrix. - robust_
cov - Compute a robust coefficient covariance matrix.