Run Nimble Model in Parallel Function will run a Nimble model for 'nc' indepdendent chains

run_nimble_model(
  code,
  data,
  constants = NULL,
  inits,
  monitors = NULL,
  ncores = NULL,
  ni = 10000,
  nb = 100,
  nt = 1,
  nc = 1,
  aI = 200,
  ntries = 5,
  calculate = FALSE,
  block.name = "alpha+b",
  block.samp.type = "AF_slice",
  parallel = TRUE
)

Arguments

code

nimble model code

data

data as a list

constants

constants as list

inits

list of initial values

monitors

optional Character vector of parameters to monitor.

ncores

maximum number of cores to employ. Actual number used is the minimum of nc and ncores

ni

number iterations to run

nb

number of burn-in iterations to discard (I think it's PRE-THINNING burnin discard...)

nt

thinning rate (every Nth iteration will be saved)

nc

number of chains to run (in parallel)

aI

adapt interval, used in nimble::addSamplers

ntries

optional If using parameter block sampler, specify the maximum number of tries

calculate

logical if TRUE will calculate the model logprob. Used as argument 'calculate' in function nimble::nimbleModel()

block.name

optional one of c("alpha+b", "all"). If "alpha+b" will block each alpha and b across all T. If "all" will block all alpha and b for each Ts.

block.samp.type

optional one of c("AF_slice", "RW_block").

parallel

logical if TRUE will run chains in parallel (using foreach).