Correct for right truncation in estimates of time-varying reproduction number
Source:R/right_truncation_correction.R
right_truncation_correction.RdThis function calculates the correction factor for each observed time of symptom onset, t. It uses the cumulative distribution function (pnorm) of the normal distribution to calculate the probability that the serial interval is less than the time lag T_now - t, where T_now is the current time.
Usage
right_truncation_correction(
t,
T_now,
mean_serial_interval,
sd_serial_interval,
distribution = "normal"
)Arguments
- t
integer; time point of infection or symptom onset
- T_now
interger; current time point
- mean_serial_interval
numeric; mean of serial interval distribution
- sd_serial_interval
numeric; standard deviation of serial interval distribution
- distribution
character string; assumed serial interval distribution, takes arguments "normal" or "gamma".