1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! **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`).
pub use ;
pub use ;
pub use ;