Learn R Programming

EpiModel (version 0.95)

epiDCM: Deterministic Compartmental Epidemic Models

Description

This function solves deterministic compartmental epidemic models for infectious disease.

Usage

epiDCM(type, groups = 1, s.num, i.num, r.num = 0, trans.rate, act.rate,
  rec.rate = 0, b.rate = 0, ds.rate = 0, di.rate = 0, dr.rate = 0,
  s.num.g2, i.num.g2, r.num.g2 = 0, trans.rate.g2, act.rate.g2,
  rec.rate.g2 = 0, b.rate.g2 = 0, ds.rate.g2 = 0, di.rate.g2 = 0,
  dr.rate.g2 = 0, balance, nsteps, dt, odemethod, new.mod = NULL,
  print.mod = FALSE, verbose = FALSE, ...)

Arguments

type
disease type to be modeled, with the choice of "SI" for Susceptible-Infected diseases, "SIR" for Susceptible-Infected-Recovered diseases, and "SIS" for Susceptible-Infected-Susceptible diseases.
groups
number of mixing groups to model, with the default of 1 for purely random mixing in the population, or 2 for purely heterogenous mixing (e.g., two sexes with purely heterosexual contact).
s.num
number of initial susceptibles in the population. For two-group models, this is the number of initial group 1 susceptible in the population.
i.num
number of initial infecteds in the population. For two-group models, this is the number of initial group 1 infected in the population.
r.num
number of initial recovereds in the population. For two-group models, this is the number of initial group 1 recovered in the populations. This parameter is only used for the SIR model type.
trans.rate
probability of transmission given an act or contact between a susceptible and an infected person in the population. In two-group models this is the rate governing the probability of transmission to the group 1 members.
act.rate
average number of acts governing transmission per person per unit time, regardless of disease status. For two-group models, this is the number of acts per group 1 persons per unit time; note that a balance between the acts in groups 1 and 2 is nec
rec.rate
average rate of recovery with immunity (in SIR models) or re-susceptibility (in SIS models). The recovery rate is a function of the disease duration as 1/duration of disease. For two-group models, this is the recovery rat
b.rate
birth rate into the population. For one-group models, the birth rate is the probability of a new birth per person per unit time. For two-group models, the birth rate may be parameterized as a rate per group 1 person per unit time (with group 1 per
ds.rate
mortality rate for susceptibles, i.e. the probability of death per susceptible person per unit time. For two-group models, it is the rate for the group 1 susceptibles only.
di.rate
mortality rate for infecteds, i.e., the probability of death per infected person per unit time. For two-group models, it is the rate for the group 1 infecteds only.
dr.rate
mortality rate for recovereds, i.e., the probability of death per recovered person per unit time. For two-group models, it is the rate for the group 1 recovered only. This parameter is only used for SIR models.
s.num.g2
number of initial susceptibles in group 2 in the population. This parameter is only used for two-group models.
i.num.g2
number of initial infecteds in group 2 in the population. This parameter is only used for two-group models.
r.num.g2
number of initial recovereds in group 2 in the population. This parameter is only used for two-group SIR models.
trans.rate.g2
probability of transmission given an act or contact between a susceptible group 2 person and an infected group 1 person in the population. It is the rate governing the probability of transmission to group 2 members.
act.rate.g2
average number of acts capable of transmission per group 2 person per unit time. Note that a balance between the acts in groups 1 and 2 is necessary, and set using the balance parameter.
rec.rate.g2
average rate of recovery with immunity (in SIR models) or re-susceptibility (in SIS models) for group 2 persons. This parameter is only used for two-group SIR and SIS models.
b.rate.g2
birth rate into the population for group 2. This may either be specified numerically as the number of new births per group 2 persons per unit time, or as NA in which case the group 1 rate, b.rate, governs the birth proces
ds.rate.g2
mortality rate for group 2 susceptibles, i.e., the probability of death per group 2 susceptible person per unit time.
di.rate.g2
mortality rate for group 2 infecteds, i.e., the probability of death per group 2 infected person per unit time.
dr.rate.g2
mortality rate for group 2 recovereds, i.e., the probability of death per group 2 recovered person per unit time. This parameter is only used for SIR model types.
balance
for two-group models, balance the act.rate to the rate set for group 1 (with balance="g1") or group 2 (with balance="g2"). Further details provided below.
nsteps
number of time steps to solve the model over. This must be a positive integer.
dt
fractional time unit for ODE solutions, with the default of 1. Model solutions for fractional timesteps may be obtained by setting this to a number between 0 and 1.
odemethod
ODE integration method, with the default for the Runge-Kutta 4 method (see ode for other options)
new.mod
if not NULL, this parameter requires an object containing a function specifying a new mathematical model form to be solved over. This functionality allows the user to specify a different system of differential equations than those cur
print.mod
if TRUE, running epiDCM will print the model form given the specified type and groups. This is used to see the mathematical structure of the current model form, as well as obtain a base functiona
verbose
if TRUE, print modelling progress to the console
...
additional parameters to pass to model, currently not used

Value

  • This function returns a list object of class epiDCM with the following elements:
    • type:disease type as specified in model parameter.
    • groups:groups as specified in model parameter.
    • params:list of model parameters as specified in model parameter.
    • time:a vector of time steps over which the model was solved.
    • vital:logical, whether vital dynamics were specified in the parameterization.
    • nruns:number of independent model runs.
    • call:exact model call.
    • *.num:a vector (ifnruns=1) or data frame (ifnruns>1) of compartment or state sizes over time, for each model run, where * may equals,i, orrfor susceptible, infected, or recovered, respectively. Two group models have equivalent elements with a.g2suffix.
    • *.flow:a vector (ifnruns=1) or data frame (ifnruns>1) of transition sizes between compartments, for each model run, where * may equalsifor susceptible to infected flows,isfor infected to susceptible flows,irfor infected to recovered flows,bfor birth in-flows,dsfor susceptible death out-flows,difor infected death out-flows,drfor recovered death out-flows. Two group models have equivalent elements with a.g2suffix.

The act.rate Parameter

The act.rate parameter represents the average number of acts capable of transmission per person per unit time. In the sexually transmitted disease modeling literature, the term ``contact'' if often used, as in the standard formulation $R_0=\beta c D$. But contact may either mean the number of independent acts or number of partnerships per person per unit time. In the latter case, one often obtains the risk of transmission within a partnership per unit time by solving the formula $\tau = 1-(1-\alpha)^n$, where $\tau$ is the probability of transmission per partnership, $\alpha$ is the probability of transmission per act, and $n$ is the number of acts per partnership. act.rate parameter is to be distinguished from ``effective contact,'' which here is the product of trans.rate and act.rate.

In two-group models, it is necessary to maintain a balance between the number of acts for group 1 members and those for group 2 members. Mathematically in a purely heterogenous mixing framework, the product of one group size and act rate must equal the product of the other group size and act rate: $N_1 \alpha_1 = N_2 \alpha_2$, where $N_i$ is the group size and $\alpha_i$ the group-specific act rates at time $t$.

Sensitivity Analyses

The epiDCM function has been designed to facilitate DCM sensitivity analyses, wherein one may run a series of models while varying one or more of the model parameters. This is possible, as shown in the example below, by specifying any parameter as a vector of length greater than one. See the Section 2.3 of the ../doc/Tutorial.pdf{EpiModel Tutorial vignette.} for further explanation and example.

Details

The epiDCM function is uses the ordinary differential equation solver in the deSolve package to model disease as a deterministic compartmental system. The current implementation of this function is limited to one- and two- group models with disease types for Susceptible-Infected (SI), Susceptible- Infected-Recovered (SIR), and Susceptible-Infected-Susceptible (SIS). The one-group model, specified with the parameter groups=1, assumes purely random mixing in the population. The two-group model, groups=2, models purely heterogenous mixing in the population, wherein group 1 members may only have contact with group 2 members (e.g., a heterosexual-only disease transmission). This will be further expanded in future releases of EpiModel.

One important caveat is the current parameter structure of specifing initial state sizes and individual parameters as primary epiDCM parameters will be deprecated in the EpiModel v1.0 release. More flexibile passing of model behavior and parameters will be implemented.

See Also

Analysis, plotting, and extraction of model data are available through the summary.epiDCM, plot.epiDCM, and as.data.frame.epiDCM functions, respectively. For further discussion of expanding DCMs past the current parameterizations, see the HTML vignette ../doc/ExtendepiDCM.html{Extending DCMs Past EpiModel}.

Examples

Run this code
## SI Model (One-Group)
mod <- epiDCM(type="SI", s.num = 500, i.num = 1,
              trans.rate = 0.2, act.rate = 0.25, nsteps = 500)
plot(mod)

## SIR Model with Vital Dynamics (One-Group)
mod <- epiDCM(type = "SIR", s.num=1000, i.num = 1, r.num = 0,
              trans.rate = 0.2, act.rate = 5, rec.rate = 1/3,
              b.rate = 1/90, ds.rate = 1/100, di.rate = 1/35,
              dr.rate = 1/100, nsteps = 500)
plot(mod)

## SIS Model with act.rate Sensitivity Parameter
mod <- epiDCM(type="SIS", s.num = 500, i.num = 1, r.num = 0,
              trans.rate = 0.2, act.rate = seq(0.1, 0.5, 0.1),
              rec.rate = 1/50, nsteps = 500, verbose = TRUE)
plot(mod)

## SI Model with Vital Dynamics (Two Groups)
mod <- epiDCM(type = "SI", groups = 2,
              s.num = 500, i.num = 1, s.num.g2 = 500, i.num.g2 = 0,
              trans.rate = 0.4,  trans.rate.g2 = 0.1,
              act.rate = 0.25, balance = "g1",
              b.rate = 1/100, b.rate.g2 = NA,
              ds.rate = 1/100, ds.rate.g2 = 1/100,
              di.rate = 1/50, di.rate.g2 = 1/50,
              nsteps = 500)
plot(mod)

Run the code above in your browser using DataLab