Usage
autorun.jags(model=stop("No model supplied"),
monitor = stop("No monitored variables supplied"),
data=NA, n.chains=2, inits = replicate(n.chains, NA),
startburnin = 5000, startsample = 10000,
psrf.target = 1.05, crash.retry = 1,
thin.sample = FALSE, jags = findjags(),
silent.jags = FALSE, interactive=TRUE, max.time=Inf,
adaptive=list(type="burnin", length=200))
Arguments
model
a character string of the model in the JAGS language. No default.
monitor
a character vector of the names of variables to monitor. No default.
data
either a named list or a character string in the R dump format containing the data. If left as NA, the model will be run without external data.
n.chains
the number of chains to use with the simulation. More chains will improve the sensitivity of the convergence diagnostic, but will cause the simulation to run more slowly. The minimum (and default) number of chains is 2.
inits
a character vector with length equal to either n.chains or length 1. Each element of the vector must be a character string in the R dump format representing the initial values for that chain. If inits is of length 1, all chains will be run using the sam
startburnin
the number of initial updates to discard before sampling. Only used on the initial run before checking convergence. Default 5000 iterations.
startsample
the number of samples on which to assess convergence. More samples will give a better chance of allowing the chain to converge, but will take longer to achieve. Also controls the length of the pilot chain used to assess the required sampling length. Th
psrf.target
the value of the point estimate for the potential scale reduction factor of the Gelman Rubin statistic below which the chains are deemed to have converged (must be greater than 1). Default 1.05.
crash.retry
the number of times to re-attempt a simulation if the model returns an error. Default 1 retry (simulation will be aborted after the second crash).
thin.sample
option to thin the final MCMC chain(s) before calculating summary statistics and returning the chains. Thinning heavily autocorrelated, very long chains allows summary statistics to be calculated more quickly. If TRUE, the chain is thinned to as close t
jags
the system call or path for activating JAGS. Default calls findjags() to attempt to locate JAGS on your system.
silent.jags
should the JAGS output be suppressed? (logical) If TRUE, no indication of the progress of individual models is supplied. Default FALSE.
interactive
option to allow the simulation to be interactive, in which case the user is asked if the simulation should be extended when run length and convergence calculations are performed and the extended simulation will take more than 1 minute. The function will
max.time
the maximum time the function is allowed to run for, as a character string including units or as an integer in which case units are taken as seconds. Ignored if interactive==TRUE. If the function thinks that the next simulation extension will result in
adaptive
a list of advanced options controlling the length of the adaptive mode of each simulation. Extended simulations do not require an adaptive phase, but JAGS prints a warning if one is not performed. Reduce the length of the adpative phase for very time co