pub enum RhoPrior {
Flat,
Normal {
mean: f64,
sd: f64,
},
GammaPrecision {
shape: f64,
rate: f64,
},
PenalizedComplexity {
upper: f64,
tail_prob: f64,
},
Independent(Vec<RhoPrior>),
}Expand description
Fixed prior family for smoothing parameters in joint HMC refinement.
Variants§
Flat
Normal
GammaPrecision
Gamma(shape, rate) conjugate hyperprior on the precision lambda = exp(rho).
The deterministic REML/LAML objective uses the MAP-in-lambda convention
and is minimized, so this contributes rate * exp(rho) - (shape - 1) * rho
up to an additive constant. Samplers over rho include the +rho Jacobian
from lambda = exp(rho), so their log-density contribution is
shape * rho - rate * exp(rho). For a block with effective dimension n_p
and centered quadratic
(beta - mu)'S_p(beta - mu), the conditional posterior is
Gamma(shape + n_p/2, rate + quadratic/2) and the closed-form MAP
precision is (shape + n_p/2 - 1) / (rate + quadratic/2).
Gamma(1, 0) is the explicit flat/default case and reproduces the
current MacKay/Tipping fixed point.
PenalizedComplexity
Penalized-complexity (PC) prior on the smoothing parameter (Simpson, Rue, Riebler, Martins, Sørbye, Statistical Science 2017).
A PC prior fixes a base model (here the infinitely-smooth limit, where
the penalized component collapses to its null space) and puts an
exponential prior on the distance away from it. For a Gaussian smooth
with precision λ = exp(ρ) the relevant distance is the marginal
standard-deviation scale d = λ^{-1/2} = exp(-ρ/2), and a constant-rate
penalization p(d) = θ exp(-θ d) induces the closed-form log-prior
log p(ρ) = ln(θ/2) − ρ/2 − θ exp(−ρ/2).The rate θ is calibrated by the single interpretable tail statement
P(d > upper) = tail_prob, i.e. θ = −ln(tail_prob) / upper. The prior
is reparameterization-invariant and shrinks toward the simpler model
(an exponential wall against under-smoothing, only a gentle linear pull
toward over-smoothing), which is exactly the Occam behaviour wanted for
high-variance flexible components. The REML/LAML objective is minimized,
so this contributes ρ/2 + θ exp(−ρ/2) (up to an additive constant) to
the cost, with gradient 1/2 − (θ/2) exp(−ρ/2) and (always positive)
curvature (θ/4) exp(−ρ/2).
Fields
Independent(Vec<RhoPrior>)
Coordinate-specific priors for models whose smoothing parameters do not share one prior family, such as nested coefficient groups.