\@description [Questioning] 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"
)

Arguments

rts

A dataframe of containing two variables rt and date with rt being numeric and date being a date.

initial_cases

Integer, initial number of cases.

initial_date

Date, (i.e as.Date("2020-02-01")). Starting date of the simulation.

generation_interval

Numeric vector describing the generation interval probability density

rdist

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

delay_defs

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.

reporting_effect

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.

reporting_model

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.

truncate_future

Logical, should cases be truncated if they occur after the first date reported in the data. Defaults to TRUE.

type

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.

Value

A dataframe containing three variables: date, cases and reference.

See also

simulate_infections