Draws a parameter vector theta from the model prior (via a sample_prior = "only" brmsfit) and simulates data y ~ p(y | theta) using
brms::posterior_predict(). Each task uses a distinct prior draw,
deterministically indexed by task_ctx$rep_idx, so Simulation-Based
Calibration ranks are well-defined and resume is reproducible.
Usage
prior_predictive_generator(
prior_fit,
predictor_generator = NULL,
vars_of_interest = NULL,
response = NULL
)Arguments
- prior_fit
A brmsfit compiled with
sample_prior = "only"(or a formula + family + prior combination to be compiled; see Details). Must contain prior draws.- predictor_generator
Function
(data_spec, task_ctx) -> data.frameproducing the design matrix of predictors (everything except the response). Must consume the ambient RNG state. IfNULL, the prior_fit's own data is reused at its original size.- vars_of_interest
Character vector naming the prior parameters to report as
true_params(defaults to all population-level effects"b_<name>", renamed to<name>).- response
Name of the response column (defaults to the LHS of
prior_fit's formula).