Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

Solow

GitHub repository  ·  Runnable examples  ·  Stochastic Minds

Source code: github.com/benovamurat/solow — stars, issues, and contributions welcome.

Solow is a complete statistical-modeling, econometrics, and data-visualization toolkit for Rust. It provides estimators for a wide range of statistical models, along with statistical tests, diagnostics, and data exploration — entirely in safe, dependency-light Rust.

If you have used the canonical Python statistics stack (NumPy / SciPy together with the standard econometrics-modeling package), Solow will feel familiar: the model names, the result quantities, and the formula syntax all mirror that ecosystem. The difference is that Solow is a from-scratch re-implementation in Rust, with no Python runtime and no system LAPACK/BLAS dependency.

Design principles

  • Pure Rust. The numerical core — linear algebra (SVD, eigendecomposition, Cholesky, QR, LU, pseudo-inverse), special functions (incomplete beta/gamma, erf), and the statistical distributions — is implemented in pure Rust. The only foundational dependency is ndarray. There is no system LAPACK/BLAS to install and no C toolchain to wrangle.

  • Verified against a reference. Every numerical routine is cross-checked against an authoritative reference implementation of the same models. Golden fixtures are generated from that reference and committed to the repository; the test suite asserts agreement to a tight tolerance — most quantities to 1e-8, maximum-likelihood and variational-Bayes estimates to 1e-6, and the formula engine to 1e-12. This means a model you fit with Solow returns the same numbers you would get from the established tool, not merely numbers that "look right."

  • Layered. Solow is a Cargo workspace of focused crates, each mirroring a module of a mature statistics library. You depend only on what you use, or pull in the umbrella solow crate to get everything behind one import.

  • Faithful output. Results carry the same battery of inference statistics you expect: standard errors, t/z statistics, p-values, confidence intervals, information criteria, and (where applicable) robust covariances. A human-readable summary table renders the way you are used to seeing.

What is in the box

Solow covers, among other things:

AreaCrateModels / tools
Linear regressionsolow-regressionOLS, WLS, GLS, quantile, rolling/recursive LS, robust covariances
Generalized linear modelssolow-glmGaussian, Binomial, Poisson, Gamma, Inverse-Gaussian, Negative-Binomial, Tweedie
Discrete choicesolow-discreteLogit, Probit, Poisson, MNLogit, Negative-Binomial, ordered, zero-inflated
Robust regressionsolow-robustM-estimation (Huber, Tukey biweight, Andrew wave)
Time seriessolow-tsaacf/pacf, ADF, KPSS, AutoReg, STL, Holt-Winters, Granger, cointegration
State spacesolow-statespaceKalman filter/smoother, SARIMAX, unobserved components, dynamic factor
Vector autoregressionsolow-varVAR, SVAR, VECM / Johansen
Survival / durationsolow-durationKaplan-Meier, Cox PH, log-rank
Multivariatesolow-multivariatePCA, factor analysis, MANOVA, canonical correlation
Nonparametricsolow-nonparametricLOWESS, kernel density, kernel regression
Statistical testssolow-statsnormality, heteroskedasticity, autocorrelation, ANOVA, multiple testing
Distributionssolow-distributionsdistributions and special functions (scipy-compatible)
Formula interfacesolow-formulapatsy-style design matrices from a formula string
Summary tablessolow-summarylabeled results and fixed-width summary rendering
Python bindingssolow-pyimport solow from Python (PyO3)

See the Crate reference for the full workspace.

A taste

#![allow(unused)]
fn main() {
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();

println!("R-squared = {:.3}", res.rsquared);
println!("coefficients = {:?}", res.params);
}

Read on to install Solow and work through a fuller quickstart.