Fit a CmdStan model using NUTS
Usage
enw_sample(data, model = epinowcast::enw_model(), diagnostics = TRUE, ...)
Arguments
- data
A list of data as produced by model modules (for example
enw_expectation()
,enw_obs()
, etc.) and as required for use themodel
being used.- model
A
cmdstanr
model object as loaded byenw_model()
or as supplied by the user.- diagnostics
Logical, defaults to
TRUE
. Should fitting diagnostics be returned as adata.frame
.- ...
Additional parameters passed to the
sample
method ofcmdstanr
.
Value
A data.frame
containing the cmdstanr
fit, the input data, the
fitting arguments, and optionally summary diagnostics.
See also
Functions used to help convert models into the format required for stan
enw_formula_as_data_list()
,
enw_get_cache()
,
enw_model()
,
enw_priors_as_data_list()
,
enw_replace_priors()
,
enw_set_cache()
,
enw_stan_to_r()
,
enw_unset_cache()
,
remove_profiling()
,
write_stan_files_no_profile()