Hidden wrapper function for sampling from ADMB models
.sample_admb( model, path = getwd(), iter = 2000, init = NULL, chains = 3, warmup = NULL, seeds = NULL, thin = 1, mceval = FALSE, duration = NULL, cores = NULL, control = NULL, verbose = TRUE, algorithm = "NUTS", skip_optimization = TRUE, skip_monitor = FALSE, skip_unbounded = TRUE, admb_args = NULL )
model | Name of model (i.e., 'model' for model.tpl). For non-Windows systems this will automatically be converted to './model' internally. For Windows, long file names are sometimes shortened from e.g., 'long_model_filename' to 'LONG_~1'. This should work, but will throw warnings. Please shorten the model name. See https://en.wikipedia.org/wiki/8.3_filename. |
---|---|
path | Path to model executable. Defaults to working directory. Often best to have model files in a separate subdirectory, particularly for parallel. |
iter | The number of samples to draw. |
init | A list of lists containing the initial parameter
vectors, one for each chain or a function. It is strongly
recommended to initialize multiple chains from dispersed
points. A of NULL signifies to use the starting values
present in the model (i.e., |
chains | The number of chains to run. |
warmup | The number of warmup iterations. |
seeds | A vector of seeds, one for each chain. |
thin | The thinning rate to apply to samples. Typically not used with NUTS. |
mceval | Whether to run the model with |
duration | The number of minutes after which the model will quit running. |
cores | The number of cores to use for parallel
execution. Default is number available in the system minus
1. If |
control | A list to control the sampler. See details for further use. |
verbose | Flag whether to show console output (default) or suppress it completely except for warnings and errors. Works for serial or parallel execution. |
algorithm | The algorithm to use, one of "NUTS" or "RWM" |
skip_optimization | Whether to run the optimizer before running MCMC. This is rarely need as it is better to run it once before to get the covariance matrix, or the estimates are not needed with adaptive NUTS. |
skip_monitor | Whether to skip calculating diagnostics
(effective sample size, Rhat) via the |
skip_unbounded | Whether to skip returning the unbounded version of the posterior samples in addition to the bounded ones. It may be advisable to set to FALSE for very large models to save space. |
admb_args | A character string which gets passed to the command line, allowing finer control |