MCMCdef_dummy {compareMCMCs} | R Documentation |
These functions are normally called from
compareMCMCs
, which passes its arguments or elements
extracted from its arguments to these functions.
MCMCdef_dummy(MCMCinfo, MCMCcontrol, monitorInfo, modelInfo)
MCMCdef_jags(MCMCinfo, MCMCcontrol, monitorInfo, modelInfo)
MCMCdef_stan(MCMCinfo, MCMCcontrol, monitorInfo, modelInfo)
MCMCinfo |
The named element of |
MCMCcontrol |
The |
monitorInfo |
A list with elements |
modelInfo |
The |
These functions are called internally from
compareMCMCs
. Each one runs an MCMC engine.
Functions to interface to other MCMC engines can be registered
via registerMCMCengine
.
MCMCs in nimble
are run from runNIMBLE
. This uses a different
system because there may be multiple nimble MCMC configurations for
one model.
MCMCdef_dummy
does not run a real MCMC. It provides a quick way
to generate MCMC-formatted output for testing other parts of this
package.
MCMCdef_jags
runs JAGS via package rjags
. It uses model
information from modelInfo
. It does not use MCMCinfo
.
MCMCdef_stan
runs Stan via package rstan
. It does not use
modelInfo
. It accepts the following elements of the MCMCinfo
list:
file
: file
argument to stan_model
function in rstan
.
This can alternatively be provided via stan_model_args$file
.
data
: data
argument to sampling
function in rstan
. This
can alternatively be provided via sampling_args$data
.
inits
: inits
argument to sampling
function in rstan
.
This can alternatively be provided via sampling_args$inits
.
stan_model_args
: list of arguments to stan_model
. Note that this
can provide the stan model in the model_code
element (as a character string)
or in the file
element (an alternative way to provide the file name).
sampling_args
: list of arguments to sampling
.
The elements file
, data
, and inits
take precendence over
corresponding entries in stan_model_args
or sampling_args
.
If elements warmup
, iter
, and/or thin
are provided in
sampling_args
, those take precedence over corresponding values in
the MCMCcontrol
argument to compareMCMCs
. Otherwise iter
is
set to MCMCcontrol$niter
and warmup
is set to
MCMCcontrol$niter/2
. Only one chain will be run.
Total sampling time for Stan is recorded via
system.call(sampling(...))
. This is similar to how time is
recorded for other MCMCs. The warmup time (called "burnin" in
compareMCMCs
for consistency across different MCMCs) is obtained
from rstan
function get_elapsed_time
. The post-burnin time is
the total sampling time minus the burnin time.