get_infections_from_incidence.Rd
This function takes as input incidence data of delayed observations of infections events, as well as the probability distribution(s) of the delay(s). It returns an inferred incidence of infection events.
get_infections_from_incidence( incidence_data, smoothing_method = "LOESS", deconvolution_method = "Richardson-Lucy delay distribution", delay, is_partially_reported_data = FALSE, delay_until_final_report = NULL, output_infection_incidence_only = TRUE, ref_date = NULL, time_step = "day", ... )
incidence_data | An object containing incidence data through time. It can either be:
|
---|---|
smoothing_method | string. Method used to smooth the original incidence data. Available options are:
|
deconvolution_method | string. Method used to infer timings of infection events from the original incidence data (aka deconvolution step). Available options are:
|
delay | Single delay or list of delays. Each delay can be one of:
|
is_partially_reported_data | boolean.
Set to |
delay_until_final_report | Single delay or list of delays. Each delay can be one of:
|
output_infection_incidence_only | boolean. Should the output contain only the estimated infection incidence? (as opposed to containing results for intermediary steps) |
ref_date | Date. Optional. Date of the first data entry in |
time_step | string. Time between two consecutive incidence datapoints.
"day", "2 days", "week", "year"... (see |
... | Arguments passed on to
|
Time series of infections through time.
If ref_date
is provided then a date column is included with the output.
This function can account for the observations being dependent on future delayed observations,
with the is_partially_reported_data
flag.
For instance, if the incidence data represents symptom onset events, usually these events
are dependent on a secondary delayed observation: a case confirmation typically, or
a hospital admission or any other type of event.
When setting is_partially_reported_data
to TRUE
,
use the delay_until_final_report
argument to specify the delay
from infection until this secondary delayed observation.
## Basic usage of get_infections_from_incidence # Recovering infection events from case incidence data assuming distinct gamma # distributions for the delay between infection and symptom onset, and the delay # between symptom onset and case reporting. shape_incubation = 3.2 scale_incubation = 1.3 delay_incubation <- list(name="gamma", shape = shape_incubation, scale = scale_incubation) shape_onset_to_report = 2.7 scale_onset_to_report = 1.6 delay_onset_to_report <- list(name="gamma", shape = shape_onset_to_report, scale = scale_onset_to_report) infections_1 <- get_infections_from_incidence( HK_incidence_data$case_incidence, delay = list(delay_incubation, delay_onset_to_report) ) ## Advanced usage of get_infections_from_incidence # Recovering infection events from symptom onset data, assuming the same delay # distributions as above infections_2 <- get_infections_from_incidence( HK_incidence_data$onset_incidence, delay = delay_incubation, is_partially_reported_data = TRUE, delay_until_final_report = delay_onset_to_report, ref_date = HK_incidence_data$date[1] )