Maps from cases by date of infection to date of report via date of
onset.
adjust_infection_to_report(
infections,
delay_defs,
reporting_model,
reporting_effect,
type = "sample",
truncate_future = TRUE
)
A data.table
containing a date
variable (date of report) and a
cases
variable. If return_onset = TRUE
there will be a third variable
reference
which indicates what the date variable refers to.
<data.table>
containing a date
variable and a numeric
cases
variable.
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 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.
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.
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.
Logical, should cases be truncated if they occur
after the first date reported in the data. Defaults to TRUE
.