Skip to main content

Crate gam_inference

Crate gam_inference 

Source

Re-exports§

pub use hmc_io as hmc;
pub use gam_data as data;

Modules§

alo
Approximate-leave-one-out (ALO) REML-evidence diagnostics. Descended from the monolith inference::alo (#1521): its only dependencies are the gam-solve estimate/pirls/sensitivity/mixture_link modules plus gam-linalg and gam-problem — all at or below the gam-solve tier.
atom_lens
Two-score per-atom lens (#980, amended): an additive per-atom report on a fitted SaeManifoldTerm.
certificate_impls
[Certificate] implementations for the existing certificate zoo (task #16).
certificates
The unified certificate contract (task #16).
checkpoint_dynamics
Cross-checkpoint training-dynamics inference for SAE atoms (issue #1102).
diagnostics
Analytic diagnostic helpers for LAML/REML optimization.
dispersion_cov
Newtype wrappers that disambiguate the two coefficient-space second-order quantities used throughout inference.
fisher_rao
formula_dsl
full_conformal
Exact full-conformal prediction for penalized GAMs — including the smoothing-parameter response (#942).
functionals
generative
gpu_polya_gamma
GPU Pólya–Gamma sampler primitive — INCOMPATIBLE with shipped probit BMS (different model).
harvest
Two-tier Fisher harvest: Fisher-on-subsample by design (#987, amending the #980 harvest contract).
higher_order
Higher-order likelihood asymptotics for likelihood-ratio tests (issue #939): Bartlett corrections that make the first-order χ² reference distribution second-order accurate at modest n and near-boundary λ.
hmc_io
NUTS Sampler using general-mcmc
lawley
Lawley (1956) cumulant assembly for Bartlett corrections (#939).
layer_transport
Functorial inter-layer concept transport maps (issue #1013).
model
model_comparison
Honest, calibrated model comparison computed from machinery already present at the fit optimum — exact smoothing-corrected conditional AIC and zero-refit ALO elpd with an influence diagnostic (issue #946).
model_payload_builders
Shared, source-agnostic builders for saved-model payloads.
pg_gate_evidence
Deterministic Pólya–Gamma gate-block evidence (#1016): Schur-eliminates a logit gate sub-block with a true PG-augmented quadratic. Descended from the monolith inference::pg_gate_evidence (#1521): depends only on gam-linalg (matrix::FactorizedSystem, faer_ndarray) plus the in-crate pg_moments. Reached downward from gam_sae::structure_harvest; the monolith crate root re-exports it so gam::inference::pg_gate_evidence resolves unchanged. Deterministic Pólya–Gamma gate-block evidence for logit SAE gates (#1016).
pg_moments
Closed-form Pólya–Gamma moments (#1016). Pure functions of (b, c) with no RNG. Descended from the monolith inference::pg_moments (#1521); the monolith crate root re-exports it so gam::inference::pg_moments resolves unchanged. Analytic Pólya–Gamma moments for deterministic gate-block evidence approximations (#1016).
polya_gamma
polya_gamma_core
Shared Pólya–Gamma PG(1, c) sampler core — single source of the Devroye algorithm’s math and constants for every CPU/GPU host path.
posterior
predict_io
probability
probe_runner
ProbeRunner — the closed loop between the steering primitive (crate::inference::steering) and the anytime-valid structure-evidence ledger (gam_terms::inference::structure_evidence).
quadrature
#1521: the quadrature implementation was carved into gam-solve. The root gam crate re-exports it so crate::quadrature::* (and crate::quadrature) resolve to the single canonical gam_solve::quadrature types — eliminating the stale monolith duplicate of QuadratureContext that diverged from the carved copy.
residual_factor
Structured residual-covariance estimator (#974) and the single producer of MetricProvenance::WhitenedStructured. Descended from the monolith inference::residual_factor (#1521): its only dependencies are gam_problem::RowMetric plus gam-linalg (faer_ndarray::{FaerCholesky, FaerEigh}) — all at or below the gam-solve tier. Reached downward from gam_sae::structure_harvest; the monolith crate root re-exports it so gam::inference::residual_factor resolves unchanged. #974 — the structured-residual covariance estimator and the single producer of MetricProvenance::WhitenedStructured.
rho_posterior
Exact marginal smoothing inference over the smoothing parameters ρ (issue #938): the Tier-0 PSIS certificate, plus the auto-selected escalation tiers — Tier-1 Gauss-Hermite quadrature over ρ (K ≤ 4, rho_posterior_quadrature) and Tier-2 NUTS over ρ with the exact profiled gradient (K ≤ 16, rho_posterior_nuts), routed by escalate_rho_posterior when the certificate refuses to certify the plug-in.
riesz
row_measure
RowSamplingMeasure — the Fisher-mass enrichment producer (role (c) of #980).
row_metric
sample
Library-side orchestration for NUTS posterior sampling from a saved model.
skovgaard
Skovgaard’s modified directed likelihood root r* for a scalar interest parameter (issue #939, deliverable 3).
smooth_test
Wood-style smooth-component Wald tests.
steering
steer_delta — the steering primitive with output dosimetry: the actionable LLM payload of the SAE-manifold machine.
structure_evidence
Anytime-valid structure discovery: e-process gates, universal-inference atom tests, e-BH error control, and KL-optimal steering probes.
truncated_gaussian
Exact posterior sampling for a Gaussian (Laplace) coefficient posterior restricted to a feasible polytope {β : A β ≥ b}.
util