Skip to contents

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 an obj argument.

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().

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)
} # }