Description Usage Arguments Details See Also Examples
View source: R/simcases-analyse.R
Analyse Datasets for multiple cases/scenarios using Bayesian methods. Results are saved to disk.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | smc_analyse(
models,
cases,
code = "",
code.add = "",
code.values = NULL,
monitor = ".*",
inits = list(),
mode = sma_set_mode("report"),
deviance = TRUE,
path = ".",
progress = FALSE,
options = furrr::future_options(seed = TRUE),
environment = parent.frame(),
fun = function(x) read.table(text = gsub(";|,| |:|\t|\\||&|~", "\t",
readLines(textConnection(x))), header = TRUE),
...
)
|
models |
A data frame or an object that becomes a data frame when |
cases |
A data frame or an object that becomes a data frame when |
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. To be used only if not specified in |
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 containing the 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 of mcmc parameters set using [simanalyse::sma_set_mode()]. |
deviance |
A flag. Indicates whether to monitor deviance for future DIC calculation. |
path |
A string specifying the path to the directory. |
progress |
A flag specifying whether to print a progress bar. |
options |
The future specific options to use with the workers. |
environment |
The environment in which the objects described in |
fun |
A function to convert |
... |
Unused. |
The arguments code
, code.add
, code.values
, monitor
, inits
, mode
and deviance
will only be used if not specified within models
.
[simanalyse::sma_set_mode()]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | normal <- "a ~ dnorm(0, 1/sigma^2)"
sigma1 <- list(sigma=1)
sigma2 <- list(sigma=2)
all <- ".*"
models_sims <- "code constants
normal sigma1
normal sigma2"
smc_simulate(models = models_sims,
path = tempdir(),
exists = NA,
ask = FALSE,
nsims = 2)
models_analysis <- "code monitor
normal all
normal all"
cases <- "sims analyse
1 1
2 2"
smc_analyse(models = models_analysis,
cases = cases,
path = tempdir())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.