The mcmc
argument can be a compiled or uncompiled NIMBLE MCMC algorithm, which is generated using buildMCMC
. Using a compiled algorithm will give substantially faster execution.
If provided, the inits
argument can be one of three things:
(1) a function to generate initial values, which will be executed to generate initial values at the beginning of each MCMC chain,
(2) a single named list of initial values which, will be used for each chain, or
(3) a list of length nchains
, each element being a named list of initial values which be used for one MCMC chain.
The inits
argument may also be omitted, in which case the current values in the model
object will be used as the initial values of the first chain, and subsequent chains will begin using starting values where the previous chain ended.
Other aspects of the MCMC algorithm, such as sampler assignments and thinning, must be specified in advance using the MCMC configuration object (created using configureMCMC
), which is then used to build the MCMC algorithm (using buildMCMC
) argument.
The niter
argument specifies the number of pre-thinning MCMC iterations, and the nburnin
argument will remove post-thinning samples.
The MCMC option mcmc$run(..., reset = FALSE)
, used to continue execution of an MCMC chain, is not available through runMCMC()
.