SISnRiskGroups: SIS model with multiple risk groups (P 3.2).

Description Usage Arguments Details Value References See Also Examples

View source: R/SISnRiskGroups.R

Description

Solves a SIS model with n different risk-groups.

Usage

1
SISnRiskGroups(pars = NULL, init = NULL, time = NULL, ...)

Arguments

pars

list with: the number of risk groups, a (m x m) matrix with the transmission rates, a vector with the recovery rates (one for each risk group) and a vector with the proportions of the population that are in each risk group. The names of these elements must be "m", "beta", "gamma" and "n", respectively (see example). All rates are specified in years.

init

vector with m * 2 values: the initial proportions of susceptibles and infectious in each risk group. The names of these values must be "S1",..., "Sm" and "I1",..., "Im", respectively (see example). All initial states must be positive and Si + Ii = ni, i= 1, ..., m.

time

time sequence for which output is wanted; the first value of times must be the initial time.

...

further arguments passed to ode function.

Details

This is the R version of program 3.2 from page 64 of "Modeling Infectious Disease in humans and animals" by Keeling & Rohani.

All parameters must be positive, and ni <= 1, sum(ni) = 1, i = 1, ..., m.

Value

list. The first element, *$model, is the model function. The second, third and fourth elements are the vectors (*$pars, *$init, *$time, containing the pars, init and time arguments of the function. The fifth element *$results is a data.frame with up to as many rows as elements in time. First column contains the time. The following columns contain the proportion of susceptibles and infectious of each risk group.

References

Keeling, Matt J., and Pejman Rohani. Modeling infectious diseases in humans and animals. Princeton University Press, 2008.

See Also

ode.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Parameters and initial conditions.
tmp <-matrix(c(0, 3, 10, 60, 100))
beta <- 0.0016 * tmp %*% t(tmp)
parameters <- list(m = 5, beta = beta, 
                   gamma = c(0.2, 0.2, 0.2, 0.2, 0.2),
                   n = c(0.06, 0.31, 0.52, 0.08, 0.03))
initials <- c(I = c(0, 0, 0, 0, 1e-5))

# Solve and plot.
sis.n.riks.groups <- SISnRiskGroups(pars = parameters, 
                                    init = initials, 
                                    time = 0:30)
PlotMods(sis.n.riks.groups, grid = FALSE)

EpiDynamics documentation built on March 26, 2020, 6:33 p.m.