Skip to contents

Resamples 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 (Nicenboim et al., 2024). A prior-predictive interval that fails to span the observed data signals a mis-scaled prior.

Usage

prior_predictive_check(model, data = NULL, ndraws = 100)

Arguments

model

A fitted brmsfit.

data

Data holding the outcome column; defaults to the model's data.

ndraws

Prior-predictive draws summarized.

Value

A list with the prior-predictive median and central 99\ the observed outcome range, and covers_observed; NULL if the model cannot be sampled from the prior (for example under improper priors).

References

Nicenboim, B., Schad, D., & Vasishth, S. (2024). Introduction to Bayesian Data Analysis for Cognitive Science.

Examples

if (interactive()) {
fit <- run_scd_analysis(simulate_scd_data())$model
prior_predictive_check(fit)
}