
Inflate Prior or Posterior Distributions by a Variance Factor
Source:R/inflate_priors.R
inflate_priors.RdTakes a priors or posteriors list object and inflates the variance of each distribution by a multiplicative factor while preserving the mean. This is used in staged Bayesian estimation to broaden tight posteriors from one stage before passing them as priors to the next stage, preventing weight collapse in importance sampling (particle filter / BFRS) when consecutive stages target different objectives.
The technique is known as kernel smoothing, covariance inflation, or variance tempering in the Sequential Monte Carlo literature (Liu & West 2001; Del Moral et al. 2006).
Usage
inflate_priors(
priors,
inflation_factor = 2,
params = NULL,
n_samples = 10000L,
verbose = TRUE
)Arguments
- priors
List. A priors or posteriors object with
parameters_globalandparameters_locationslots.- inflation_factor
Numeric scalar > 0. Variance multiplier.
2.0doubles variance while preserving the mean. Default 2.0.- params
Optional character vector. Base parameter names to inflate. When
NULLall non-fixed/frozen parameters are inflated.- n_samples
Integer. Number of samples for the empirical methods (gompertz and unrecognised distributions). Default 10000L.
- verbose
Logical. Print per-parameter inflation messages. Default TRUE.
Methods
Each distribution is inflated using the most appropriate method:
Analytic (exact):
- beta(shape1, shape2)
Reduce precision
s = shape1 + shape2by factorf. Maximum inflatable factor isf_max = s+1.- gamma(shape, rate)
shape_new = shape/f, rate_new = rate/f.- lognormal(meanlog, sdlog)
CV² scaled by
f;meanlogadjusted to preserve natural-scale mean.- lognormal(mean, sd)
sd_new = sqrt(f)*sd. For either lognormal form, truncation boundslower/upperare kept and apply to the inflated distribution.- normal(mean, sd)
sd_new = sqrt(f)*sd.- uniform(min, max)
Bounds extended symmetrically around midpoint. Skipped with a warning if new bounds violate positivity.
- truncnorm(mean, sd, a, b)
sd_new = sqrt(f)*sd; the pre-truncationmeanand the boundsa,bare left unchanged, so the underlying normal is inflated exactly. When a bound is active the truncated distribution's mean shifts (towards the midpoint of the bounds) and its variance grows by less thaninflation_factor.
Empirical (sample → inflate → refit):
- gompertz(b, eta)
No closed-form moments. Sampled empirically, variance inflated, distribution refit via MLE.
- Any other distribution
Universal empirical fallback.