View source: R/simanalyse-analyse.R
sma_analyse | R Documentation |
Analyse data for a simulation study. Allows results to be written to files.
sma_analyse( sims, code, code.add = "", code.values = NULL, monitor = ".*", inits = list(), mode = sma_set_mode("report"), deviance = TRUE, progress = FALSE, options = furrr::furrr_options(seed = TRUE) )
sims |
An nlists or nlist object of the data (or list that can be coerced to nlist or nlists). |
code |
A string of code to analyze the data. JAGS code must not be in a data or model block. |
code.add |
A string of code to add at the end of |
code.values |
A character vector to replace all instances of "?" in the model. This is useful for varying choices of distributions, e.g. for assessing sensitivity to the choice of priors. |
monitor |
A character vector (or regular expression if a string) specifying the names of the stochastic nodes to output from the analysis. By default all stochastic nodes are included. |
inits |
A list or a function. Initial values for the MCMC chains. If specifying a function, it should either have no arguments, or have a single argument named chain. In the latter case, the supplied function is called with the chain number as argument. In this way, initial values may be generated that depend systematically on the chain number. |
mode |
A list obtained from sma_set_mode which sets the parameters of the mcmc sampling. |
deviance |
A flag. Indicates whether to monitor deviance for future DIC calculation. |
progress |
A flag specifying whether to print a progress bar. |
options |
The future specific options to use with the workers. |
A flag.
set.seed(10L) code <- "a ~ dnorm(mu,1)" sims <- sims::sims_simulate(code, parameters = nlist(mu=0), nsims=2) prior = "mu ~ dunif(-3,3)" result <- sma_analyse(sims=sims, code = code, code.add = prior, mode=sma_set_mode("quick"), monitor = "mu")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.