gamlss
Type-driven Rust crates for GAMLSS-style distributional regression.
Status: Actively developed. Public APIs and numerical behavior may change before 1.0.
Overview
GAMLSS models the full conditional response distribution rather than only its mean:
$$ Y_i \mid x_i \sim D(\theta_{i1}, \ldots, \theta_{iK}), \qquad g_k(\theta_{ik}) = X_{k,i}\beta_k + \sum_j f_{k,j}(x_i). $$
Each distribution parameter can have its own link, covariates, smooth terms, and penalties. The typed API expresses parameter domains and model structure at compile time while keeping model evaluation backend- and optimizer-agnostic.
The library supports scalar distributional models, optional multivariate families, finite mixtures, smooth predictors, target transforms, post-fit diagnostics, and a lightweight Bayesian posterior-potential layer. Distribution functions, quantiles, CRPS, and sampling are exposed through capability traits and vary by family. See the family capability matrix for exact coverage.
Fitting loops and optimizer integrations intentionally remain outside the core API.
Crates
Most users should depend on the gamlss facade. The workspace also publishes focused crates:
gamlss-coreandgamlss-familyprovide typed model abstractions, distributions, likelihoods, and scores.gamlss-splineandgamlss-specialprovide predictors, penalties, special functions, and numerical helpers.gamlss-transformandgamlss-diagnosticscover response preprocessing and post-fit diagnostics.gamlss-formulais an experimental builder layer for curated workflows;gamlss-bayesprovides priors and posterior potentials without a sampler.
See project structure for API layers and crate boundaries.
Features
formula(default) re-exports the experimental builder API.bayesenablesgamlss::bayesand its common prelude types.randenables sampling for supported families.multivariateenables multivariate families.
Use default-features = false for the facade without the formula layer, or depend on individual crates for tighter dependency control.
Development
Run the workspace checks with:
Run the main benchmarks with:
Each crate's benches/README.md documents focused Criterion filters and coverage. Compare benchmark results only on the same hardware and toolchain.