Load and compile the nowcasting model
Usage
enw_model(
model = system.file("stan", "epinowcast.stan", package = "epinowcast"),
include = system.file("stan", package = "epinowcast"),
compile = TRUE,
threads = TRUE,
profile = FALSE,
target_dir = epinowcast::enw_get_cache(),
stanc_options = list(),
cpp_options = list(),
verbose = TRUE,
...
)
Arguments
- model
A character string indicating the path to the model. If not supplied the package default model is used.
- include
A character string specifying the path to any stan files to include in the model. If missing the package default is used.
- compile
Logical, defaults to
TRUE
. Should the model be loaded and compiled usingcmdstanr::cmdstan_model()
.- threads
Logical, defaults to
TRUE
. Should the model compile with support for multi-thread support in chain. Note that setting this will produce a warning thatthreads_to_chain
is set and ignored. Changing this toFALSE
is not expected to yield any performance benefits even when not using multithreading and thus not recommended.- profile
Logical, defaults to
FALSE
. Should the model be profiled? For more on profiling see thecmdstanr
documentation. # nolint- target_dir
The path to a directory in which the manipulated .stan files without profiling statements should be stored. To avoid overriding of the original .stan files, this should be different from the directory of the original model and the
include_paths
.- stanc_options
A list of options to pass to the
stanc_options
ofcmdstanr::cmdstan_model()
. By default nothing is passed but potentially users may wish to pass optimisation flags for example. See the documentation forcmdstanr::cmdstan_model()
for further details.- cpp_options
A list of options to pass to the
cpp_options
ofcmdstanr::cmdstan_model()
. By default nothing is passed but potentially users may wish to pass optimisation flags for example. See the documentation forcmdstanr::cmdstan_model()
for further details. Note that thethreads
argument replacesstan_threads
.- verbose
Logical, defaults to
TRUE
. Should verbose messages be shown.- ...
Additional arguments passed to
cmdstanr::cmdstan_model()
.
See also
Functions used to help convert models into the format required for stan
enw_formula_as_data_list()
,
enw_get_cache()
,
enw_priors_as_data_list()
,
enw_replace_priors()
,
enw_sample()
,
enw_set_cache()
,
enw_stan_to_r()
,
enw_unset_cache()
,
remove_profiling()
,
write_stan_files_no_profile()