Learn R Programming

EpiEstim (version 1.1-2)

DiscrSI: Discretized Generation Time Distribution Assuming A Shifted Gamma Distribution

Description

DiscrSI computes the discrete distribution of the serial interval, assuming that the serial interval is shifted Gamma distributed, with shift 1.

Usage

DiscrSI(k, mu, sigma)

Arguments

k

positive integer for which the discrete distribution is desired.

mu

a positive real giving the mean of the Gamma distribution.

sigma

a non-negative real giving the standard deviation of the Gamma distribution.

Value

DiscrSI(k, mu, sigma) gives the discrete probability \(w_k\) that the serial interval is equal to \(k\).

Details

Assuming that the serial interval is shifted Gamma distributed with mean \(\mu\), standard deviation \(\sigma\) and shift \(1\), the discrete probability \(w_k\) that the serial interval is equal to \(k\) is:

\(w_k = kF_{\{\mu-1,\sigma\}}(k)+(k-2)F_{\{\mu-1,\sigma\}}(k-2)-2(k-1)F_{\{\mu-1,\sigma\}}(k-1)\\+(\mu-1)(2F_{\{\mu-1+\frac{\sigma^2}{\mu-1},\sigma\sqrt{1+\frac{\sigma^2}{\mu-1}}\}}(k-1)-F_{\{\mu-1+\frac{\sigma^2}{\mu-1},\sigma\sqrt{1+\frac{\sigma^2}{\mu-1}}\}}(k-2)-F_{\{\mu-1+\frac{\sigma^2}{\mu-1},\sigma\sqrt{1+\frac{\sigma^2}{\mu-1}}\}}(k))\)

where \(F_{\{\mu,\sigma\}}\) is the cumulative density function of a Gamma distribution with mean \(\mu\) and standard deviation \(\sigma\).

References

Cori, A. et al. A new framework and software to estimate time-varying reproduction numbers during epidemics. (submitted)

See Also

OverallInfectivity, EstimateR, WT

Examples

Run this code
# NOT RUN {
## Computing the discrete serial interval of influenza
MeanFluSI <- 2.6
SdFluSI <- 1.5
DicreteSIDistr <- vector()
for(i in 0:20)
{
    DicreteSIDistr[i+1] <- DiscrSI(i, MeanFluSI, SdFluSI)
}
plot(0:20, DicreteSIDistr, type="h", lwd=10, lend=1, xlab="time (days)", ylab="frequency")
title(main="Discrete distribution of the serial interval of influenza")
# }

Run the code above in your browser using DataLab