Expand description
§Model Estimation via Penalized Likelihood and REML
This module orchestrates the core model fitting procedure for Generalized Additive Models (GAMs). It determines optimal smoothing parameters directly from the data, moving beyond simple hyperparameter-driven models. This is achieved through a nested optimization scheme, a standard approach for this class of models:
-
Outer Loop (planner-selected optimizer): Optimizes the log-smoothing parameters (
rho) by maximizing a marginal likelihood criterion. For non-Gaussian models (e.g., Logit), this is the Laplace Approximate Marginal Likelihood (LAML). The concrete solver is chosen centrally byrho_optimizerfrom the derivative capability of the model path: ARC with analytic Hessian when available, BFGS for gradient-only problems, and EFS / hybrid EFS when the hyperparameter geometry admits those fixed-point updates. -
Inner Loop (P-IRLS): For each set of trial smoothing parameters from the outer loop, this routine finds the corresponding model coefficients (
beta) by running a Penalized Iteratively Reweighted Least Squares (P-IRLS) algorithm to convergence.
This two-tiered structure allows the model to learn the appropriate complexity for each smooth term directly from the data.
Re-exports§
pub use crate::model_types::AdaptiveRegularizationOptions;pub use crate::model_types::FitArtifacts;pub use crate::model_types::FitGeometry;pub use crate::model_types::FitInference;pub use crate::model_types::FitOptions;pub use crate::model_types::FittedBlock;pub use crate::model_types::FittedLinkState;pub use crate::model_types::UnifiedFitResult;pub use crate::model_types::UnifiedFitResultParts;pub use crate::model_types::saved_latent_cloglog_state_from_fit;pub use crate::model_types::saved_mixture_state_from_fit;pub use crate::model_types::saved_sas_state_from_fit;pub use crate::model_types::validate_dense_hessian_export;pub use crate::model_types::validate_explicit_dense_hessian_for_whitening;
Modules§
Structs§
- Continuous
Smoothness Order - External
Joint Hyper Evaluator - External
Optim Options - External
Optim Result - Model
Summary - Parametric
Term Summary - Smooth
Term Summary
Enums§
- Block
Role - Role of a coefficient block within a multi-parameter model.
- Coefficient
Prior Mean - Programmatic prior mean for a coefficient penalty block.
- Continuous
Smoothness Order Status - Dispersion
- Dispersion contract used by inferential covariance and reference distributions.
- Estimation
Error - A comprehensive error type for the model estimation process.
- Penalty
Coordinate - A rho-coordinate always contributes
- Penalty
Spec - A penalty specification for the public estimate API.
Constants§
Functions§
- compute_
continuous_ smoothness_ order - dispersion_
from_ likelihood - ensure_
finite_ scalar - Public wrapper returning
Stringerrors for use outside the estimation module. - evaluate_
external_ ift_ residual_ at_ perturbed_ rho - Evaluate IFT and flat warm-start inner residuals at
rho + delta_rho. - evaluate_
externalcost_ andridge - Evaluate the external cost and report the stabilization ridge used. This is a diagnostic helper for tests that need to detect ridge jitter.
- evaluate_
externalgradient - Evaluate the analytic gradient of the external REML objective.
- fit_gam
- External-design GAM entrypoint for GLM-style families supported by
optimize_external_design. Survival families such asRoystonParmaruse survival-specific training APIs. - fit_
gam_ with_ penalty_ specs - fit_
gamwith_ heuristic_ lambdas - optimize_
external_ design - Optimize smoothing parameters for an external design using the same REML/LAML machinery.
- optimize_
external_ designwith_ heuristic_ lambdas - Same as
optimize_external_design, but allows heuristic λ warm-start seeds for the outer smoothing search. - validate_
all_ finite - Public wrapper returning
Stringerrors for use outside the estimation module.