jags2_baker | R Documentation |
JAGS
from RThe jags function takes data and starting values as input. It automatically writes a jags script, calls the model, and saves the simulations for easy access in R. Check the R2jags::jags2 for details about the argument.
jags2_baker(
data,
inits,
parameters.to.save,
model.file = "model.bug",
n.chains = 3,
n.iter = 2000,
n.burnin = floor(n.iter/2),
n.thin = max(1, floor((n.iter - n.burnin)/1000)),
DIC = TRUE,
jags.path = "",
working.directory = NULL,
clearWD = TRUE,
refresh = n.iter/50
)
data |
(1) a vector or list of the names of the data objects used by the model, (2) a (named) list of the data objects themselves, or (3) the name of a "dump" format file containing the data objects, which must end in ".txt", see example below for details. |
inits |
a list with |
parameters.to.save |
character vector of the names of the parameters to save which should be monitored. |
model.file |
file containing the model written in |
n.chains |
number of Markov chains (default: 3) |
n.iter |
number of total iterations per chain (including burn in; default: 2000) |
n.burnin |
length of burn in, i.e. number of iterations to
discard at the beginning. Default is |
n.thin |
thinning rate. Must be a positive integer. Set
|
DIC |
logical; if |
jags.path |
directory that contains the |
working.directory |
sets working directory during execution of this function; This should be the directory where model file is. |
clearWD |
indicating whether the files ‘data.txt’,
‘inits[1:n.chains].txt’, ‘codaIndex.txt’, ‘jagsscript.txt’,
and ‘CODAchain[1:nchains].txt’ should be removed after |
refresh |
refresh frequency for progress bar, default is |
This modifies the jags2 function in R2jags package.
Same as R2jags::jags()
R2jags::jags()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.