Learn R Programming

R0 (version 1.2-10)

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

Description

Estimate the reproduction number by maximum likelihood

Usage

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

Value

A list with components:

R

The estimate of the reproduction ratio.

conf.int

The 95% confidence interval for the R estimate.

epid

Original or augmented epidemic data, depending whether impute.incid is set to FALSE or TRUE.

epid.orig

Original epidemic data.

GT

Generation time distribution uised in the computation.

begin

Starting date for the fit.

begin.nb

The number of the first day used in the fit.

end

The end date for the fit.

end.nb

The number of the las day used for the fit.

pred

Prediction on the period used for the fit.

Rsquared

Correlation coefficient between predicted curve (by fit.epid) and observed epidemic curve.

call

Call used for the function.

method

Method used for fitting.

method.code

Internal code used to designate method.

Arguments

epid

the epidemic curve

GT

generation time distribution

import

Vector of imported cases.

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

unknown.GT

When GT distribution is unknown, it is estimated jointly. See details.

impute.incid

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

Author

Pierre-Yves Boelle, Thomas Obadia

Details

For internal use. Called by est.R0.

White & Pagano (2009) detail two maximum likelihood methods for estimatig the reproduction ratio. The first (and used by default in this package) assumes that the serial interval distirbution is known, and subsequently the likelihood is only maximised depending on the value of R. The second method can be used if the serial interval distribution is unknown: in that case, the generation time is set to follow a Gamma distribution with two parameters (size, shape), and the optimization routine finds the values of R, size and shape that maximize the likelihood. However, the epidemic curve must be long enough to account for a whole generation. The authors showed that this is achieved when the cumulated amount of incident cases reaches 150. When using this method, the flag unknown.GT must be set to TRUE. GT must still be provided with a R0.GT-class object, however its mean and sd will be recycled as starting value for the optimization routine.

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.

CI is achieved by profiling the likelihood.

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