I have been developing the framework you are referring to. See
https://github.com/audrey-b/simanalyse
The R package has separate functions to simulate the datasets (using JAGS or R code), analyze (using JAGS) and evaluate the performance of the model. It can easily save all the results to files (thus saving on RAM) and parallelize on a local or cluster computer. Setting the seed is also streamlined, simply using set.seed(). The MCMC chains are automatically ran until convergence, while being thinned and burned-in to a specified size, so you do not need to guess a thinning factor.
There are a lot of evaluation measures to choose from, including bias. The currently implemented measures are: bias, relative bias, bias ratio, coverage probability, expected interval length, expected posterior variance, expected posterior standard deviation, variance, standard error, mean square error, root mean square error, relative root mean square error, coefficient of variation and power.
Here is a simple example (code subject to change since it's not on CRAN yet):
remotes::install_github("audrey-b/simanalyse")
remotes::install_github("poissonconsulting/sims")
library(simanalyse)
library(sims)
set.seed(123)
# Set up the model
code <- "for(i in 1:10){
y[i] ~ dnorm(mu, 1/sigma^2)}"
params <- list(sigma = 2)
constants <- list(mu = 0)
# Simulate 100 datasets
data <- sims::sims_simulate(code,
parameters = params,
constants = constants,
nsims = 100)
# Analyse 100 datasets
prior <- "sigma ~ dunif(0, 6)"
analyses <- sma_analyse(data,
code = code,
code.add = prior,
mode = sma_set_mode("report"))
# Evaluate the bias
sma_evaluate(analyses,
measures = "bias",
parameters = params)
term bias
sigma 0.2695341