View source: R/run_nimble_model.R
run_nimble_model | R Documentation |
Run Nimble Model in Parallel Function will run a Nimble model for 'nc' indepdendent chains
run_nimble_model( code, data, fn.samps = NULL, constants = NULL, inits, monitors = NULL, monitors2 = NULL, ncores = NULL, ni = 10000, nb = 100, nt = 1, nc = 1, aI = 200, seed = NULL, ntries = NULL, calculate = FALSE, block.name = "alpha+b", block.samp.type = "AF_slice", parallel = TRUE, mod.name = NULL, dir.out = NULL, fn.times = "runtimes.csv", save.output = TRUE )
code |
nimble model code |
data |
data as a list |
fn.samps |
filepath for .rds file where sample monitors will be saved. |
constants |
constants as list |
inits |
list of initial values |
monitors |
optional Character vector of parameters to monitor. |
monitors2 |
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 |
seed |
seed number |
ntries |
optional If using parameter block sampler, specify the maximum number of tries. Defaults to ~50% of the number of GAM basis functions. |
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). |
mod.name |
a shorthand name for saving outputs. |
dir.out |
path where samps and runtimes wll be saved |
fn.times |
filename of runtimes output. Optional. Defaults to runtimes.csv |
save.output |
Logical. If TRUE will attempt to save MCMC results output as .rds to file. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.