regression-diagnostics 0.2.0

Statistical diagnostics for OLS regression in Rust: VIF, condition number, adjusted R2, F/AIC/BIC, residual tests (Durbin-Watson, Breusch-Pagan, White, Jarque-Bera), influence measures (leverage, Cook's distance, DFFITS), QQ-plot data, and an R/statsmodels-style summary().
Documentation
//! **Mixed / hierarchical** linear models — regression for grouped (clustered,
//! repeated-measures, multilevel) data, where observations within a group are
//! correlated and ordinary least squares would understate the uncertainty.
//!
//! * [`LinearMixedModel`] — a **random-intercept** model
//!   `yᵢⱼ = xᵢⱼᵀβ + bⱼ + εᵢⱼ` with one grouping factor, fit by REML (default) or
//!   ML. Because there is a single random intercept the marginal covariance
//!   inverts in closed form per group, so estimation is a one-dimensional search
//!   over the variance ratio `λ = σ²_b/σ²_e` — no general optimizer needed.
//! * [`MixedModel`] — the **general** Gaussian LMM: one or more
//!   [`RandomEffect`] terms giving **random slopes** and/or **crossed / nested**
//!   grouping factors. Profiles `β` and `σ²_e` out and optimizes the relative
//!   covariance parameters with Nelder–Mead over a dense Cholesky solve; it
//!   reduces to [`LinearMixedModel`] exactly for a single intercept term.
//! * [`GlmmFit`] — a **generalized** linear mixed model (random intercept,
//!   Poisson or Bernoulli) via the **Laplace approximation**: an inner Newton
//!   loop for the conditional modes inside an outer search over `β` and `σ_b`.
//!
//! The diagnostics that matter here are the ones OLS cannot express: the
//! **variance components**, the **intraclass correlation** `ICC` (how much of the
//! variance is between groups), the shrinkage **BLUPs** of the group effects, and
//! fixed-effect standard errors that account for the within-group correlation.
//!
//! # Scope and scale
//!
//! The general models use a dense `O(n³)` solve — appropriate for the grouped
//! datasets these diagnostics target, not for very large `n`. The random-intercept
//! [`LinearMixedModel`] is exact: for a **balanced** one-way design its REML
//! variance components equal the classical ANOVA estimators (`tests/mixed.rs`).

mod general;
mod glmm;
mod lmm;

pub use general::{MixedModel, RandomEffect};
pub use glmm::{GlmmFamily, GlmmFit};
pub use lmm::{LinearMixedModel, Method};