An MLE is optional. With init = "auto", the selected MLE is used when
available; otherwise the configured active parameter vector is supplied.
Usage
sbt_mcmc(
fit,
sampler = "snuts",
init = "auto",
check = TRUE,
check_args = list(),
...
)Arguments
- fit
An
sbt_fit()object.- sampler
"snuts"or a sampler function accepting anobjargument.- init
Initial-value policy or sampler-specific initial values.
- check
Run
check_mcmc()after sampling.- check_args
Named arguments passed to
check_mcmc().- ...
Settings passed to the sampler. These override package defaults.
Value
The sampled sbt_fit, containing portable posterior draws, sampler
settings and diagnostics, and, when check = TRUE, a payload-bound MCMC
validation record.
Details
The default SparseNUTS settings are 500 retained samples, 1,000
warm-up iterations, four chains, four cores, and
control = list(adapt_delta = 0.999). Supply alternative values through
.... When check = TRUE, the returned fit must pass the sampler and
biological-state checks implemented by check_mcmc().
See also
Other fit workflow:
check_mcmc(),
check_mle(),
sbt_add_bounds(),
sbt_add_map(),
sbt_add_msy(),
sbt_add_parameters(),
sbt_add_priors(),
sbt_build_object(),
sbt_example_fit(),
sbt_fit(),
sbt_fit_compatibility(),
sbt_fit_io,
sbt_fit_rebuild(),
sbt_fit_report(),
sbt_fit_validate(),
sbt_fit_validation(),
sbt_obj(),
sbt_optimise()
Examples
if (FALSE) { # \dontrun{
fit <- sbt_example_fit()
fit <- sbt_mcmc(
fit,
num_samples = 500L,
num_warmup = 1000L,
chains = 4L,
cores = 4L
)
sbt_fit_validation(fit, scope = "mcmc", require_pass = TRUE)
} # }
