enw_pathfinder | R Documentation |
For more information on the pathfinder algorithm see the CmdStan documentation. # nolint
enw_pathfinder(
data,
model = epinowcast::enw_model(),
diagnostics = TRUE,
init = NULL,
...
)
data |
A list of data as produced by model modules (for example
|
model |
A |
diagnostics |
Logical, defaults to |
init |
A list of initial values or a function to generate initial values. If not provided, the model will attempt to generate initial values |
... |
Additional parameters to be passed to |
Note that the threads_per_chain
argument is renamed to num_threads
to
match the CmdStanModel$pathfinder()
method.
This fitting method is faster but more approximate than the NUTS sampler
used in enw_sample()
and as such is recommended for use in exploratory
analysis and model development.
A data.table containing the fit, data, and fit_args. If diagnostics is TRUE, it also includes the run_time column with the timing information.
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_sample()
,
enw_set_cache()
,
enw_stan_to_r()
,
enw_unset_cache()
,
remove_profiling()
,
write_stan_files_no_profile()
pobs <- enw_example("preprocessed")
nowcast <- epinowcast(pobs,
expectation = enw_expectation(~1, data = pobs),
fit = enw_fit_opts(enw_pathfinder, pp = TRUE),
obs = enw_obs(family = "poisson", data = pobs),
)
summary(nowcast)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.