Skip to contents

This function estimates the time-varying reproduction number (R_t) using the method proposed by Wallinga and Teunis (AJE 2004). The function takes as input a data frame with incidence data and requires the specification of the serial interval distribution. The user must input the mean and standard deviation of the serial interval distribution and select the functional form: Normal or Gamma.

Usage

rt_estim_w_boot(inc_dat, mean_si, sd_si, dist_si = "normal", n_bootstrap = 100)

Arguments

inc_dat

data frame; data frame with incidence data. The data frame should have two columns: inc (daily incidence) and onset_date. Onset_date does not have to be in date format, it can be a column of days, such as c(1,2,3,4, ... ),

mean_si

numeric; mean of serial interval distribution

sd_si

numeric; standard deviation of serial interval distribution

dist_si

string; distribution to be assumed for serial interval. Accepts "normal" or "gamma".

n_bootstrap

integer; number of bootstrap samples of the serial interval distribution

Value

A named list of two data frames. The first data frame (results) contains the mean, mediean, 2.5th percentile, and 97.5th percentile from all of the boot strapped samples. The second data frame (boot_samples) contains all boot strap samples for each time point.