.sample_admb {adnuts}R Documentation

Hidden wrapper function for sampling from ADMB models


Hidden wrapper function for sampling from ADMB models


  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



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 to model executable. Defaults to working directory. Often best to have model files in a separate subdirectory, particularly for parallel.


The number of samples to draw.


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., obj$par) for all chains.


The number of chains to run.


The number of warmup iterations.


A vector of seeds, one for each chain.


The thinning rate to apply to samples. Typically not used with NUTS.


Whether to run the model with -mceval on samples from merged chains.


The number of minutes after which the model will quit running.


The number of cores to use for parallel execution. Default is number available in the system minus 1. If cores=1, serial execution occurs (even if chains>1), otherwise parallel execution via package snowfall is used. For slow analyses it is recommended to set chains<=cores so each core needs to run only a single chain.


A list to control the sampler. See details for further use.


Flag whether to show console output (default) or suppress it completely except for warnings and errors. Works for serial or parallel execution.


The algorithm to use, one of "NUTS" or "RWM"


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.


Whether to skip calculating diagnostics (effective sample size, Rhat) via the rstan::monitor function. This can be slow for models with high dimension or many iterations. The result is used in plots and summaries so it is recommended to turn on. If model run with skip_monitor=FALSE you can recreate it post-hoc by setting fit$monitor=rstan::monitor(fit$samples, fit$warmup, print=FALSE).


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.


A character string which gets passed to the command line, allowing finer control

[Package adnuts version 1.1.2 Index]