getR0: Function to compute the basic R0 given a set of parameters.

View source: R/getR0.R

getR0R Documentation

Function to compute the basic R0 given a set of parameters.

Description

Function to compute the basic R0 given a set of parameters.

Usage

getR0(
  infPeriodSpec = c("exp", "PS", "IDD"),
  beta,
  X,
  N,
  infExpParams = NULL,
  infPSParams = NULL,
  infIDDParams = NULL
)

Arguments

infPeriodSpec

A character indicating which model for the infectious period will be used.

beta

vector with elements for each column of X which specify the transmission rate over time.

X

The design matrix corresponding to the intensity process over epidemic time.

N

Integer, population size.

infExpParams

A list giving parameters specific to the exponentially distributed infectious period. See details for specifics.

infPSParams

A list giving parameters specific to the path-specific distributed infectious period. See details for specifics.

infIDDParams

A list giving parameters specific to the infectious duration-dependent infectious period. See details for specifics.

Details

getR0 computes the basic reproductive number which may change over epidemic time due to an intervention. Reproductive numbers can be calculated under three specifications of the infectious period: the exponential distribution, the path-specific (PS) approach of Porter and Oleson (2013), or the infectious-duration dependent (IDD) formulation of Ward et al. (upcoming).

infPeriodSpec determines which model will be used to simulate the epidemic. Model specific parameter values are entered using either infExpParams, infPSParams, or infIDDParams.

All models use the beta parameter vector associated with each column of the matrix X to describe transmission over epidemic time. All models assume exponentially distributed time spent in the latent period with rate parameter, rateE.

For the exponential model infPeriodSpec = 'exp', only one additional parameter needs to be specified in infExpParams: rateI, which is the rate parameter associated with the removal probability.

For the path-specific model infPeriodSpec = 'PS', infPSParams should contain three elements: dist, maxInf, and psParams. dist gives the distribution used to describe the length of time spent in the infectious period Currently only the exponential ("exp"), gamma ("gamma"), and Weibull ("weibull") distributions are supported. maxInf corresponds to the maximum length of time an individual can spend in the infectious compartment, at which point the removal probability becomes 1. psParams must provide a list of parameter values for the parameters associated with the chosen distribution. For dist = 'gamma', these are the shape and rate parameters and for dist = 'weibull', these are the shape and scale parameters.

For the infectious-duration dependent model infPeriodSpec = 'IDD', infIDDParams should contain three elements: maxInf, iddFun, and iddParams. maxInf corresponds to the total length of time each individual spends in the infectious compartment. iddFun gives the IDD function used to describe the IDD curve. iddParams must provide a list of parameter values for the parameters associated with the chosen iddFun. For example, if iddFun = dgammaIDD, these are the shape and rate parameters.

Value

A vector with the value of the basic reproductive number R0(t) over the epidemic

References

Porter, Aaron T., and Jacob J. Oleson. "A path-specific SEIR model for use with general latent and infectious time distributions." Biometrics

Examples


# simulate epidemic over 100 days
tau <- 100

# specify the design matrix so there is a change point in transmission at time 50
X <- cbind(1, c(rep(0, 49), rep(1, tau - 49)))


# simulate using exponentially distributed infectious period
datExp <- simSEIR(S0 = 999, E0 = 0, I0 = 1, N = 1000, tau = tau,
                  beta = c(0.1, -2), X = X, rateE = 0.1,
                  infPeriodSpec = 'exp',
                  infExpParams = list(rateI = 0.2))
                  
# plot incidence curve
plot(datExp$Istar, type = 'l', main = 'Incidence', xlab = 'Epidemic Time',
     ylab = 'Count')
     
# get reproductive number over time
getR0(infPeriodSpec = 'exp', beta = c(0.1, -2), X = X, N = 1000,
      infExpParams = list(rateI = 0.2))
     
# simulate using IDD infectious period using the gamma PDF
datIDD <- simSEIR(S0 = 999, E0 = 0, I0 = 1, N = 1000, tau = tau,
                  beta = c(0.7, -1.5), X = X, rateE = 0.1,
                  infPeriodSpec = 'IDD',
                  infIDDParams = list(maxInf = 14,
                                      iddFun = dgammaIDD,
                                      iddParams = list(shape = 4, rate = 1))) 
                                      
# plot incidence curve
plot(datIDD$Istar, type = 'l', main = 'Incidence', xlab = 'Epidemic Time',
     ylab = 'Count')
     
# get reproductive number over time
getR0(infPeriodSpec = 'IDD', beta = c(0.7, -1.5), X = X, N = 1000,
      infIDDParams = list(maxInf = 14,
                          iddFun = dgammaIDD,
                          iddParams = list(shape = 4, rate = 1)))


ceward18/BayesSEIR documentation built on June 15, 2022, 11:06 a.m.