This function encapsulates option passing to the stan sampler, with the
exception of the model object, which is passed in imugap_options.
Arguments
- ...
Arguments passed on to
rstan::samplingdataA named
listorenvironmentproviding the data for the model or a character vector for all the names of objects used as data. See the Passing data to Stan section instan.parsA vector of character strings specifying parameters of interest. The default is
NAindicating all parameters in the model. Ifinclude = TRUE, only samples for parameters named inparsare stored in the fitted results. Conversely, ifinclude = FALSE, samples for all parameters except those named inparsare stored in the fitted results.chainsA positive integer specifying the number of Markov chains. The default is 4.
iterA positive integer specifying the number of iterations for each chain (including warmup). The default is 2000.
warmupA positive integer specifying the number of warmup (aka burnin) iterations per chain. If step-size adaptation is on (which it is by default), this also controls the number of iterations for which adaptation is run (and hence these warmup samples should not be used for inference). The number of warmup iterations should be smaller than
iterand the default isiter/2.thinA positive integer specifying the period for saving samples. The default is 1, which is usually the recommended value.
seedThe seed for random number generation. The default is generated from 1 to the maximum integer supported by R on the machine. Even if multiple chains are used, only one seed is needed, with other chains having seeds derived from that of the first chain to avoid dependent samples. When a seed is specified by a number,
as.integerwill be applied to it. Ifas.integerproducesNA, the seed is generated randomly. The seed can also be specified as a character string of digits, such as"12345", which is converted to integer.initInitial values specification. See the detailed documentation for the init argument in
stan.check_dataLogical, defaulting to
TRUE. IfTRUEthe data will be preprocessed; otherwise not. See the Passing data to Stan section instan.sample_fileAn optional character string providing the name of a file. If specified the draws for all parameters and other saved quantities will be written to the file. If not provided, files are not created. When the folder specified is not writable,
tempdir()is used. When there are multiple chains, an underscore and chain number are appended to the file name prior to the.csvextension.diagnostic_fileAn optional character string providing the name of a file. If specified the diagnostics data for all parameters will be written to the file. If not provided, files are not created. When the folder specified is not writable,
tempdir()is used. When there are multiple chains, an underscore and chain number are appended to the file name prior to the.csvextension.verboseTRUEorFALSE: flag indicating whether to print intermediate output from Stan on the console, which might be helpful for model debugging.algorithmOne of sampling algorithms that are implemented in Stan. Current options are
"NUTS"(No-U-Turn sampler, Hoffman and Gelman 2011, Betancourt 2017),"HMC"(static HMC), or"Fixed_param". The default and preferred algorithm is"NUTS".controlA named
listof parameters to control the sampler's behavior. See the details in the documentation for thecontrolargument instan.includeLogical scalar defaulting to
TRUEindicating whether to include or exclude the parameters given by theparsargument. IfFALSE, only entire multidimensional parameters can be excluded, rather than particular elements of them.coresNumber of cores to use when executing the chains in parallel, which defaults to 1 but we recommend setting the
mc.coresoption to be as many processors as the hardware and RAM allow (up to the number of chains).open_progressLogical scalar that only takes effect if
cores > 1but is recommended to beTRUEin interactive use so that the progress of the chains will be redirected to a file that is automatically opened for inspection. For very short runs, the user might preferFALSE.show_messagesEither a logical scalar (defaulting to
TRUE) indicating whether to print the summary of Informational Messages to the screen after a chain is finished or a character string naming a path where the summary is stored. Setting toFALSEis not recommended unless you are very sure that the model is correct up to numerical error.
Value
a list of arguments matching rstan::sampling() inputs
