Refit an mlumr() model across a grid of prior_beta scales (keeping the
family, mean, and df fixed) and summarize how the posterior for the
marginal treatment effects (delta_index, delta_comparator) moves. This
is the workflow recommended by Vehtari et al.'s prior-choice wiki for
judging how much of the posterior is driven by the data versus the prior.
Arguments
- fit
A fitted
mlumr_fitobject to re-fit under alternative priors.- prior_beta_scales
Numeric vector of scales for
prior_beta. Defaultc(0.5, 1, 2.5, 5, 10).- probs
Quantiles for summarizing each posterior (default
c(0.025, 0.5, 0.975)).- verbose
Logical; if
FALSE, suppresses progress messages and final printed summary table.- ...
Additional arguments forwarded to
mlumr()on each refit (e.g.chains,iter,refresh). Sampling defaults otherwise inherit from the original fit.
Value
A data frame (tibble-style) with one row per
(scale, population, quantile) combination and columns scale,
parameter, mean, sd, and the requested quantiles. Side effect:
prints a summary table at the end.
Details
Only the scale of the prior_beta family is varied; its distribution
(normal / student_t) and mean are preserved so comparisons are apples to
apples. prior_intercept and prior_sigma are carried through
unchanged from the original fit. Each value in prior_beta_scales is
used as the absolute scale for every coefficient at that refit — if
the original fit used per-coefficient priors, all coefficients are set
to the same scale (the sweep is deliberately homogeneous so the grid
reflects a single level of prior informativeness per refit, not a
rescaling of existing relative differences). If the original
prior_beta used an exponential family, it is swapped for a
prior_normal(0, scale) at each grid point since exponential has no
scale parameter to vary.
See also
prior_summary() for a one-shot description of the priors on
a fit; marginal_effects() for the posterior summary quantities this
sweep tracks.
Examples
if (FALSE) { # \dontrun{
sens <- prior_sensitivity(fit_spfa, prior_beta_scales = c(1, 2.5, 5))
} # }
