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

Examples gallery

A tour of the major models in Solow, each illustrated end to end: a small, fully deterministic example dataset, the call that fits the model, the printed results summary, and a rendered plot. Every page corresponds to a runnable program in the solow-gallery crate, so you can reproduce any figure and summary on your own machine.

The gallery is modeled on the canonical examples index of the reference Python statistics library: one self-contained vignette per modeling family.

Running the examples

The gallery lives in its own crate (crates/solow-gallery) that is not part of the root workspace — it depends on the Solow crates by path. Run any example by name:

cargo run --manifest-path crates/solow-gallery/Cargo.toml --bin ols

Each program prints its summary to standard output and writes its plot SVG into docs/book/src/examples/img/, which is exactly where the images embedded on these pages come from.

The examples

ExampleModelPlot
Ordinary least squaresLinearModel::olsscatter + fitted line
Weighted & generalized least squaresLinearModel::wls / glsOLS vs WLS lines under heteroskedasticity
Generalized linear modelsGlm (Poisson, Logit)fitted mean / probability curves
Generalized additive modelsGlmGam (penalized B-spline)data with the fitted smooth curve
Generalized estimating equationsGee (exchangeable)clustered data with the marginal fit
Linear mixed effectsMixedLm (random intercepts)grouped data with partial-pooling levels
Robust regressionRlm (Huber's T)OLS vs robust fit with outliers
Beta regressionBetaModel(0,1) response with the fitted mean curve
Time seriesacf / pacf / AutoReg / seasonal_decomposeACF, PACF, AR fit, seasonal component
Forecasting service (case study)AutoReg (+ backtest)demand forecast with a 95% prediction band
Vector autoregressionVartwo series with an iterated forecast
State space & the Kalman filterUnobservedComponentsobserved series vs filtered state
Markov switching regimesMarkovRegressionsmoothed regime probability over time
Survival analysisSurvfuncRight (Kaplan-Meier)survival step function with bands
Copula dependenceClaytonCopulacopula density over the unit square
Empirical likelihoodDescStat−2 log-ELR profile with the χ² threshold
Principal component analysisPcascree plot + PC1/PC2 scores
Q-Q plot diagnosticsProbPlotnormal Q-Q plot with reference line
Multiple imputationconditional_mean_impute / combineimputation spread and the pooled estimate
Bayesian posteriorBayesMixedGlm (variational Bayes)posterior means with credible bands
Optimizer convergenceminimize_bfgs / newton_stationarygradient norm vs iteration (log scale)
The formula interfacesolow_fit::ols / poissonobserved vs fitted

Every figure on these pages is produced by solow-viz, Solow's dependency-light SVG plotting backend.