Expand description
Library-side orchestration for NUTS posterior sampling from a saved model.
The CLI’s gam sample subcommand and the Python Model.sample(...) API
both call into sample_saved_model, which dispatches on the saved
model’s class (standard GLM, standard with link-wiggle, or survival) and
returns a fully-converged NutsResult over the original coefficient
space. Gaussian identity standard models are sampled from the saved
closed-form posterior, conditioning on the training fit rather than any
prediction rows supplied by the caller.
Re-exports§
pub use super::hmc_io::NutsConfig;pub use super::hmc_io::NutsResult;pub use super::hmc_io::PosteriorSampler;
Functions§
- laplace_
gaussian_ fallback - Draw iid samples from the fit’s PUBLISHED Gaussian posterior
approximation
N(mode, V), whereVis the smoothing-correctedVpwhenever the fit carries one and the conditionalVb = cov_scale·H⁻¹otherwise — the same choicesummary()and the defaultpredict(interval=...)make, so one fitted object publishes one posterior (gam#2777). - sample_
saved_ model - Run NUTS posterior sampling over a saved model.
- saved_
baseline_ timewiggle_ spec - Reconstruct the
LinkWiggleFormulaSpecfrom a saved model’s baseline-time-wiggle runtime, returningNonewhen the model has no time-wiggle component. Re-exported because the survival fitter’s tests exercise the spec independently of running NUTS.