
Prior predictive check for a fitted SCD model
Source:R/utils-diagnostics.R
prior_predictive_check.RdResamples the model from the prior alone and compares the implied outcome distribution to the observed data range, the prior-predictive step of the Bayesian workflow. A prior-predictive interval that fails to span the observed data signals a mis-scaled prior.
Value
A list with the prior-predictive median and central 99\
the observed outcome range, covers_observed, and note
(NULL, or how an ar() term conditions the predictions);
NULL if the model cannot be sampled from the prior (for example
under improper priors).
Details
With a Gaussian ar() term, brms predicts each occasion
conditional on lagged residuals computed from the observed outcomes, so
prior predictions are pulled toward the observed series and the
coverage check is optimistic; the returned note says so.
Examples
if (interactive()) {
fit <- run_scd_analysis(simulate_scd_data())$model
prior_predictive_check(fit)
}