get_bootstrapped_estimates_from_combined_observations.Rd
An estimation of the effective reproductive number through time is made on the original incidence data. Then, the same estimation is performed on a number of bootstrap samples built from the original incidence data. The estimate on the original data is output along with confidence interval boundaries built from the distribution of bootstrapped estimates.
get_bootstrapped_estimates_from_combined_observations( partially_delayed_incidence, fully_delayed_incidence, smoothing_method = "LOESS", deconvolution_method = "Richardson-Lucy delay distribution", estimation_method = "EpiEstim sliding window", bootstrapping_method = "non-parametric block boostrap", uncertainty_summary_method = "original estimate - CI from bootstrap estimates", combine_bootstrap_and_estimation_uncertainties = FALSE, N_bootstrap_replicates = 100, delay_until_partial, delay_until_final_report, partial_observation_requires_full_observation = TRUE, ref_date = NULL, time_step = "day", output_Re_only = TRUE, ... )
partially_delayed_incidence | An object containing incidence data through time. It can be:
|
---|---|
fully_delayed_incidence | An object containing incidence data through time. It can 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:
|
estimation_method | string. Method used to estimate reproductive number values through time from the reconstructed infection timings. Available options are:
|
bootstrapping_method | string. Method to perform bootstrapping of the original incidence data. Available options are:
|
uncertainty_summary_method | string. One of the following options:
|
combine_bootstrap_and_estimation_uncertainties | boolean. If TRUE, the uncertainty interval reported is the union of the highest posterior density interval from the Re estimation with the confidence interval from the boostrapping of time series of observations. |
N_bootstrap_replicates | integer. Number of bootstrap samples. |
delay_until_partial | Single delay or list of delays. Each delay can be one of:
|
delay_until_final_report | Single delay or list of delays. Each delay can be one of:
|
partial_observation_requires_full_observation | boolean
Set to |
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 |
output_Re_only | boolean. Should the output only contain Re estimates? (as opposed to containing results for each intermediate step) |
... | Arguments passed on to
|
Effective reproductive estimates through time with confidence interval boundaries.
If output_Re_only
is FALSE
, then transformations made
on the input observations during calculations are output as well.
This function allows for combining two different incidence timeseries.
The two timeseries can represent events that are differently delayed from the original infection events.
The two data sources must not have any overlap in the events recorded.
The function can account for the one of the two types of events to require
the future observation of the other type of event.
For instance, one type can be events of symptom onset, and the other be case confirmation.
Typically, the recording of a symptom onset event will require a future case confirmation.
If so, the partial_observation_requires_full_observation
flag should be set to TRUE
.
## Basic usage of get_bootstrapped_estimates_from_combined_observations # (Only 10 bootstrap replicates are generated to keep the code fast. In practice, # use more.) 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) Re_estimate_1 <- get_bootstrapped_estimates_from_combined_observations( partially_delayed_incidence = HK_incidence_data$onset_incidence, fully_delayed_incidence = HK_incidence_data$report_incidence, partial_observation_requires_full_observation = TRUE, delay_until_partial = delay_incubation, delay_until_final_report = delay_onset_to_report, N_bootstrap_replicates = 10 ) ## Advanced usage of get_bootstrapped_estimates_from_combined_observations # Incorporating prior knowledge over Re. Here, Re is assumed constant over a time # frame of one week, with a prior mean of 1.25. Re_estimate_2 <- get_bootstrapped_estimates_from_combined_observations( partially_delayed_incidence = HK_incidence_data$onset_incidence, fully_delayed_incidence = HK_incidence_data$report_incidence, partial_observation_requires_full_observation = TRUE, delay_until_partial = delay_incubation, delay_until_final_report = delay_onset_to_report, N_bootstrap_replicates = 10, estimation_method = 'EpiEstim piecewise constant', interval_length = 7, mean_Re_prior = 1.25, ref_date = HK_incidence_data$date[1] ) # Incorporating prior knowledge over the disease. Here, we assume the mean of the # serial interval to be 5 days, and the deviation is assumed to be 2.5 days. The # delay between symptom onset and case confirmation is passed as empirical data. Re_estimate_3 <- get_bootstrapped_estimates_from_combined_observations( partially_delayed_incidence = HK_incidence_data$onset_incidence, fully_delayed_incidence = HK_incidence_data$report_incidence, partial_observation_requires_full_observation = TRUE, delay_until_partial = delay_incubation, delay_until_final_report = delay_onset_to_report, N_bootstrap_replicates = 10, mean_serial_interval = 5, std_serial_interval = 2.5 )