Download Package `runjags`

Transcript
run.jags.study
25
Usage
run.jags.study(simulations, model=NULL, datafunction=NULL,
targets=list(), confidence=0.95, record.chains=FALSE,
runjags.options=list(), cat.progress=FALSE, test=TRUE,
parallel.method=parLapply, ...)
Arguments
simulations
the number of datasets to run the model on
model
the JAGS model to use, in the same format as would be specified to run.jags
datafunction
an optional function that will be used to specify the data. If provided, this must
take exactly one argument, representing the simulation number, and return either
a named list or character vector in the R dump format containing the data specific
to that simulation. It is possible to specify any data that does not change for each
simulation using a #data# <variable> tag in the model code. If a datafunction is
not provided, the data will be the same for all simulations (and a warning will
be printed).
targets
a named list of variables (which can include vectors/arrays) with values to which
the model outputs are compared (if stochastic). The target variable names are
also automatically included as monitored variables.
confidence
a probability (or vector of probabilities) to use when calculating the proportion
of credible intervals containing the true target value. Default 95% CI.
record.chains
option to return the full runjags objects returned from each simulation as a list
item named ’runjags’. Default FALSE.
runjags.options
a named list of options to be passed to the underlying autorun.jags function
used to run the models.
cat.progress
option to print a message when individual simulations have finished running.
This is available for use with lapply, but messages will not be printed for some
parallel methods (such as the default parLapply). Default FALSE.
test
option to test the model compilation on a single (randomly chosen) dataset,
to ensure that the model compiles before calling the parallel method. Default
TRUE.
parallel.method
a function that will be used to call the repeated simulations. This must take
the first two arguments ’X’ and ’FUN’ as for lapply, with other optional arguments passed through from the parent function call. Default uses parLapply,
but lapply or mclapply could also be used.
...
optional arguments to be passed directly to the parallel method function, such as
’cl’ in the case of parLapply.