init_cumulative_fit {EpiNow2} | R Documentation |
Generate initial conditions by fitting to cumulative cases
Description
Fits a model to cumulative cases. This may be a useful approach to
initialising a full model fit for certain data sets where the sampler gets
stuck or cannot easily be initialised as fitting to cumulative cases changes
the shape of the posterior distribution. In estimate_infections()
,
epinow()
and regional_epinow()
this option can be engaged by setting
stan_opts(init_fit = "cumulative")
.
This implementation is based on the approach taken in epidemia authored by James Scott.
Usage
init_cumulative_fit(
args,
samples = 50,
warmup = 50,
id = "init",
verbose = FALSE
)
Arguments
args |
List of stan arguments. |
samples |
Numeric, defaults to 50. Number of posterior samples. |
warmup |
Numeric, defaults to 50. Number of warmup samples. |
id |
A character string used to assign logging information on error.
Used by |
verbose |
Logical, should fitting progress be returned. Defaults to
|
Value
A stanfit object
Author(s)
Sam Abbott