Skip to main content

Crate solow_regression

Crate solow_regression 

Source
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.
BayesianRidge
Fitted BayesianRidge.
DummyClassifier
Fitted DummyClassifier.
DummyRegressor
Fitted DummyRegressor.
ElasticNet
Elastic-net penalised linear regression by coordinate descent.
ElasticNetCV
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.
GlsarResults
The fitted result of a Glsar model.
HuberRegressor
Fitted Huber regressor.
KernelRidge
Kernel ridge regression — the closed-form dual solution α = (K + λI)⁻¹ y, predicting via f(x) = Σᵢ αᵢ · k(xᵢ, x).
Lars
Fitted Lars.
Lasso
L¹-penalised linear regression by coordinate descent.
LassoCV
Cross-validated Lasso.
LassoLars
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.
LassoLarsIC
Fitted LassoLarsIC.
LinearModel
A linear regression model awaiting estimation.
LinearResults
The fitted result of a LinearModel, holding every standard quantity.
MultiTaskElasticNet
Fitted MultiTaskElasticNet.
MultiTaskLasso
Fitted MultiTaskLasso.
OrthogonalMatchingPursuit
OrthogonalMatchingPursuit — greedy sparse regression that adds one atom per iteration until either n_nonzero_coefs are selected or the residual norm drops below tol.
PassiveAggressiveClassifier
PassiveAggressiveClassifier — margin-based online classifier (Crammer et al. 2006).
PassiveAggressiveRegressor
PassiveAggressiveRegressor — ε-insensitive PA variant.
Perceptron
Perceptron — a special case of SGDClassifier with the perceptron loss.
QuantReg
A quantile-regression model awaiting a fit(q).
QuantRegResults
The fitted result of a QuantReg.
RansacRegressor
Fitted RANSAC regressor.
RecursiveLS
A recursive-least-squares model awaiting fit.
RecursiveLSResults
The fitted result of a RecursiveLS.
Ridge
L²-penalised linear regression.
RidgeCV
Cross-validated Ridge regression.
RidgeClassifier
Fitted RidgeClassifier.
RidgeClassifierCV
Fitted RidgeClassifierCV.
RollingOLS
A rolling-window OLS model awaiting fit.
RollingOLSResults
The fitted result of a RollingOLS.
SgdClassifier
Fitted SGDClassifier (binary, y ∈ {-1, +1}).
SgdRegressor
Fitted SGDRegressor.
SirResults
The fitted result of a SlicedInverseReg model.
SlicedInverseReg
A Sliced Inverse Regression model awaiting estimation.
TheilSenRegressor
Fitted TheilSen regressor (median-based linear model).

Enums§

CovType
The kind of robust covariance to compute.
DummyClassifierStrategy
DummyClassifier strategy.
DummyRegressorStrategy
DummyRegressor strategy.
InformationCriterion
Information criterion used for model selection.
RidgeKernel
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.