\@description
Simulate cases from a single Rt trace, an initial number of cases, and a reporting model
This functionality has largely been superseded by simulate_infections
and will likely to replaced
or updated to depend on stan
code.
simulate_cases(
rts,
initial_cases,
initial_date,
generation_interval,
rdist = rpois,
delay_defs,
reporting_effect,
reporting_model,
truncate_future = TRUE,
type = "sample"
)
A dataframe of containing two variables rt
and date
with
rt
being numeric and date
being a date.
Integer, initial number of cases.
Date, (i.e as.Date("2020-02-01")
). Starting date of the simulation.
Numeric vector describing the generation interval probability density
A function to be used to sample the number of cases. Must take two
arguments with the first specifying the number of samples and the second the mean. Defaults
to rpois
if not supplied
A list of single row data.tables that each defines a delay distribution (model, parameters and maximum delay for each model).
See lognorm_dist_def
for an example of the structure.
A numeric vector of length 7 that allows the scaling of reported cases by the day on which they report (1 = Monday, 7 = Sunday). By default no scaling occurs.
A function that takes a single numeric vector as an argument and returns a single numeric vector. Can be used to apply stochastic reporting effects. See the examples for details.
Logical, should cases be truncated if they occur after the first date reported in the data.
Defaults to TRUE
.
Character string indicating the method to use to transform counts. Supports either "sample" which approximates sampling or "median" would shift by the median of the distribution.
A dataframe containing three variables: date
, cases
and reference
.
simulate_infections