Backend based on sampling via cmdstanr.

SBC_backend_cmdstan_sample(model, ..., init_factory = NULL)

Arguments

model

an object of class CmdStanModel (as created by cmdstanr::cmdstan_model)

...

other arguments passed to the $sample() method of the model. The data and parallel_chains arguments cannot be set this way as they need to be controlled by the SBC package.

init_factory

an optional function that takes in a dataset and returns a value that can be passed to the init argument of $sample(). This allows for data-dependent inits. The caching mechanism in compute_SBC() ignores the environment of the function, i.e. if the init factory takes values from its environment and those values change between runs, this will not by itself cause cached results to be recomputed.