SIR2TypesImports: SIR model with two types of imports (P 6.6).

Description Usage Arguments Details Value References See Also Examples

View source: R/SIR2TypesImports.R

Description

Solves a model with two types of stochastic imports and demographic stochasticit

Usage

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

Arguments

pars

vector with 5 parameters: transmission rate, recovery rate and per capita death rate. The names of these values must be "beta", "gamma", "mu", "epsilon" and "delta" respectively. All parameters must be positive. The birth rate is assumed to be constant and equal to mu * N, therefore preventing extinction of the host population.

init

vector with 3 values: the initial population size that are susceptible, infectious and the total population size. The names of these values must be "X", "Y" and "N", respectively. All initial conditions must be positive and all refer to integer numbers.

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 6.6 from page 210 of "Modeling Infectious Disease in humans and animals" by Keeling & Rohani.

Value

list. The first, second and third elements are the vectors (*$pars, *$init, *$time, containing the pars, init and time arguments of the function. The fourth 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 number of susceptibles, infectious, recovered and boolean for epsilon and delta imports.

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
# Parameters and initial conditions.
parameters <- c(beta = 1, gamma = 0.1, mu = 5e-4,
                epsilon = 2e-5, delta = 0.01)
initials <- c(X = 5, Y = 2, N = 50)

# Solve and plot.
sir.2types.imports <- SIR2TypesImports(parameters, initials, 2 * 365)
PlotMods(sir.2types.imports)

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