rt_optimise | R Documentation |
For a given number of samples from given parameter uncertainty or distribution function, this approach iteratively fits the Rt trend to the provided death data and returns a nimue_simulation object for future usage in scenario modelling.
rt_optimise(
data,
distribution,
squire_model,
parameters,
start_date,
parallel = FALSE,
rt_spacing = 14,
k = 2,
n_particles = 14,
initial_infections_interval = c(5, 500),
rt_interval = c(0.5, 20),
dt = NULL
)
data |
A data frame of deaths occuring over a given time frame. Given in the format: deaths(integer), date_start(date), date_end(date). Must have at least one death period in each set of Rt trend changes (i.e. a 14 day period by default) and no period can overlap these changes. |
distribution |
A list of samples(a list) with names specifying parameters. |
squire_model |
A model object of the desired type to use, i.e. squire, nimue. |
parameters |
A list of parameters to keep the same across all samples. |
start_date |
Date when the epidemic begins, parameters and distribution should be formatted relative to this date, where necessary. |
parallel |
Run each sample concurrently, uses the future::plan set by the user. Default = FALSE. |
rt_spacing |
Number of days between each Rt trend, default = 14 days. |
k |
Control the dispersion on the negative binomial likelihood, default = 2. |
n_particles |
How many particles to explore uniformly the interval of initial infections, default = 7. |
initial_infections_interval |
The range of initial number of infections to explore, default = c(5, 500). |
rt_interval |
The range of values that Rt can take, default = c(0.5, 20). |
dt |
If the passed squire_model has a difference model attached, this is the step size we shall use. The difference model is only used if dt is non-null and squire_model$odin_difference_model is non-null. Defaults to NULL. |
NOTE: For death curves with periods of 0's rt_interval's lower bound must be greater than 0 else it will likely fail to overcome a low infective population and Rt will tend to some unrealistically large number.
This function is progressr enabled, so progressr::handlers(global = TRUE) can be used to view progress through the samples.
An object of type rt_optimised, (model type).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.