Learn R Programming

R0 (version 1.1-2)

est.R0.ML: Estimate the reproduction number by maximum likelihood

Description

Estimate the reproduction number by maximum likelihood

Usage

est.R0.ML(epid, GT, t = NULL, begin = NULL, end = NULL, date.first.obs = NULL, 
    time.step = 1, range = c(0.01, 50), impute.values = FALSE, 
    checked = FALSE, ...)

Arguments

epid
the epidemic curve
GT
generation time distribution
t
Vector of dates at which incidence was calculated
begin
At what time estimation begins
end
Time at which to end computation
date.first.obs
Optional date of first observation, if t not specified
time.step
Optional. If date of first observation is specified, number of day between each incidence observation
range
Range in which the maximum must be looked for
impute.values
Boolean value. If TRUE, will impute unobserved cases at the beginning of the epidemic to correct for censored data
checked
Internal flag used to check whether integrity checks were ran or not.
...
parameters passed to inner functions

Value

  • A list with components:
  • RThe estimate of the reproduction ratio.
  • conf.intThe 95% confidence interval for the R estimate.
  • epidthe epidemic curve
  • epid.origOriginal epidemic data.
  • GTgeneration time distribution
  • beginAt what time estimation begins
  • begin.nbThe number of the first day used in the fit.
  • endTime at which to end computation
  • end.nbThe number of the las day used for the fit.
  • predPrediction on the period used for the fit.
  • RsquaredCorrelation coefficient between predicted curve (by fit.epid) and observed epidemic curve.
  • callCall used for the function.
  • methodMethod used for fitting.
  • method.codeInternal code used to designate method.

Details

For internal use. Called by est.R0. The principle of the methods described by White & all is to compute the expected number of cases in the future, and optimise to get R using a Poisson distribution.

References

White, L.F., J. Wallinga, L. Finelli, C. Reed, S. Riley, M. Lipsitch, and M. Pagano. "Estimation of the Reproductive Number and the Serial Interval in Early Phase of the 2009 Influenza A/H1N1 Pandemic in the USA." Influenza and Other Respiratory Viruses 3, no. 6 (2009): 267-276.

Examples

Run this code
#Loading package
library(R0)

## Data is taken from paper by Nishiura for key transmission parameters of an institutional
## outbreak during the 1918 influenza pandemic in Germany)

data(Germany.1918)
mGT<-generation.time("gamma", c(2.45, 1.38))
est.R0.ML(Germany.1918, mGT, begin=1, end=27, range=c(0.01,50))
# Reproduction number estimate using  Maximum Likelihood  method.
# R :  1.307222[ 1.236913 , 1.380156 ]

res=est.R0.ML(Germany.1918, mGT, begin=1, end=27, range=c(0.01,50))
plot(res)

## no change in R with varying range 
## (dates here are the same index as before. Just to illustrate different use)
est.R0.ML(Germany.1918, mGT, begin="1918-09-29", end="1918-10-25", range=c(0.01,100))
# Reproduction number estimate using  Maximum Likelihood  method.
# R :  1.307249[ 1.236913 , 1.380185 ]

Run the code above in your browser using DataLab