Run a batch of iterations for a jags model and return only strategic output.
Source:R/tar_jags_rep.R
tar_jags_rep_run.RdNot a user-side function. Do not invoke directly.
Usage
tar_jags_rep_run(
jags_lines,
jags_name,
jags_file,
parameters.to.save,
data,
variables = NULL,
summaries = NULL,
summary_args = NULL,
transform = NULL,
reps,
output,
n.cluster = n.cluster,
n.chains = n.chains,
n.iter = n.iter,
n.burnin = n.burnin,
n.thin = n.thin,
jags.module = jags.module,
inits = inits,
RNGname = RNGname,
stdout = stdout,
stderr = stderr,
progress.bar = progress.bar,
refresh = refresh
)Arguments
- jags_lines
Character vector of lines from a JAGS file.
- jags_name
Friendly suffix of the jags model target.
- jags_file
Original path to the input jags file.
- parameters.to.save
Model parameters to save, passed to
R2jags::jags()orR2jags::jags.parallel(). See the argument documentation of theR2jags::jags()andR2jags::jags.parallel()help files for details.- data
A list, the original JAGS dataset.
- variables
Character vector of model parameter names. The output posterior summaries are restricted to these variables.
- summaries
List of summary functions passed to
...inposterior::summarize_draws()through$summary()on theCmdStanFitobject.- summary_args
List of summary function arguments passed to
.argsinposterior::summarize_draws()through$summary()on theCmdStanFitobject.- transform
Symbol or
NULL, name of a function that accepts argumentsdataanddrawsand returns a data frame. Here,datais the JAGS data list supplied to the model, anddrawsis a data frame with one column per model parameter and one row per posterior sample. Any arguments other thandataanddrawsmust have valid default values becausejagstargetswill not populate them. See the simulation-based calibration discussion thread at https://github.com/ropensci/jagstargets/discussions/31 for an example.- output
Character of length 1 denoting the type of output
tibbleto return:"draws"for MCMC samples (which could take up a lot of space)"summary"for lightweight posterior summary statistics, and"dic"for the overall deviance information criterion and effective number of parameters.- n.cluster
Number of parallel processes, passed to
R2jags::jags()orR2jags::jags.parallel(). See the argument documentation of theR2jags::jags()andR2jags::jags.parallel()help files for details.- n.chains
Number of MCMC chains, passed to
R2jags::jags()orR2jags::jags.parallel(). See the argument documentation of theR2jags::jags()andR2jags::jags.parallel()help files for details.- n.iter
Number if iterations (including warmup), passed to
R2jags::jags()orR2jags::jags.parallel(). See the argument documentation of theR2jags::jags()andR2jags::jags.parallel()help files for details.- n.burnin
Number of warmup iterations, passed to
R2jags::jags()orR2jags::jags.parallel(). See the argument documentation of theR2jags::jags()andR2jags::jags.parallel()help files for details.- n.thin
Thinning interval, passed to
R2jags::jags()orR2jags::jags.parallel(). See the argument documentation of theR2jags::jags()andR2jags::jags.parallel()help files for details.- jags.module
Character vector of JAGS modules to load, passed to
R2jags::jags()orR2jags::jags.parallel(). See the argument documentation of theR2jags::jags()andR2jags::jags.parallel()help files for details.- inits
Initial values of model parameters, passed to
R2jags::jags()orR2jags::jags.parallel(). See the argument documentation of theR2jags::jags()andR2jags::jags.parallel()help files for details.- RNGname
Choice of random number generator, passed to
R2jags::jags()orR2jags::jags.parallel(). See the argument documentation of theR2jags::jags()andR2jags::jags.parallel()help files for details.- stdout
Character of length 1, file path to write the stdout stream of the model when it runs. Set to
NULLto print to the console. Set toR.utils::nullfile()to suppress stdout. Does not apply to messages, warnings, or errors.- stderr
Character of length 1, file path to write the stderr stream of the model when it runs. Set to
NULLto print to the console. Set toR.utils::nullfile()to suppress stderr. Does not apply to messages, warnings, or errors.- progress.bar
Type of progress bar, passed to
R2jags::jags()orR2jags::jags.parallel(). See the argument documentation of theR2jags::jags()andR2jags::jags.parallel()help files for details.- refresh
Frequency for refreshing the progress bar, passed to
R2jags::jags()orR2jags::jags.parallel(). See the argument documentation of theR2jags::jags()andR2jags::jags.parallel()help files for details.