delay_calculator {rtestim} | R Documentation |
Calculate the total infectiousness at each observed time point.
Description
The total infectiousness at each observed time point is calculated
by \sum_{s=1}^t I_{t-s}w_s
, where I
denotes the vector containing
observed incidence, and w
denotes the generation interval
distribution. Typically, the generation interval is challenging to estimate
from data, so the serial interval is used instead. The serial interval
distribution expresses the probability
of a secondary infection caused by a primary infection which occurred s
days earlier.
Usage
delay_calculator(
observed_counts,
x = NULL,
dist_gamma = c(2.5, 2.5),
delay_distn = NULL,
delay_distn_periodicity = NULL,
xout = x
)
Arguments
observed_counts |
vector of the observed daily infection counts |
x |
a vector of positions at which the counts have been observed. In an ideal case, we would observe data at regular intervals (e.g. daily or weekly) but this may not always be the case. May be numeric or Date. |
dist_gamma |
Vector of length 2. These are the shape and scale for the assumed serial interval distribution. Roughly, this distribution describes the probability of an infectious individual infecting someone else after some period of time after having become infectious. As in most literature, we assume that this interval follows a gamma distribution with some shape and scale. |
delay_distn |
in the case of a non-gamma delay distribution,
a vector or matrix (or |
delay_distn_periodicity |
Controls the relationship between the spacing
of the computed delay distribution and the spacing of |
xout |
a vector of positions at which the results should be returned.
By default, this will be the same as |
Value
A vector containing the total infectiousness at each
point xout
.
Examples
delay_calculator(c(3, 2, 5, 3, 1), dist_gamma = c(2.5, 2.5))