This function fits a stan model using the light-weight interface provided by cmdstanr. The code was adapted from McElreath rethinking package.
Arguments
- model_code
A
characterpointing to the stan modelling code.- data
A
listwith all the parameters required to run the model_code in stan.- algorithm
A
charactergiving the algorithm to use. Either'sampling'(Default),'optimize'or'variational'for penalized likelihood estimation.- chains
A
numericindicating the number of chains to use for estimation.- cores
Number of threads for sampling. Default set to
'getOption("ibis.nthread")'. Seeibis_options().- threads
numericgiving the number of threads to be run per chain. Has to be specified in accordance with cores.- iter
A
numericvalue giving the number of MCMC samples to generate.- warmup
numericfor the number of warm-up samples for MCMC. Default set to 1/2 of iter.- control
A
listwith further control options for stan.- cpp_options
A
listwith options for the Cpp compiling.- force
logicalindication whether to force recompile the model (Default:FALSE).- path
characterindicating a path to be made available to the stan compiler.- save_warmup
A
logicalflag whether to save the warmup samples.- ...
Other non-specified parameters.
