epiICM(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, rec.rand = TRUE, b.rand = TRUE,
d.rand = TRUE, nsims = 1, verbose = TRUE)"SI" for Susceptible-Infected diseases,
"SIR" for Susceptible-Infected-Recovered diseases,
and "SIS" for Susceptible-Infected-Susceptible
diseases.1 for purely random mixing in the
population, or 2 for purely heterogenous mixing
(e.g., two sexes with purely heterosexual contact).SIR model type.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 ratSIR models.SIR models.balance parameter.SIR models) or re-susceptibility (in
SIS models) for group 2 persons. This parameter is
only used for two-group SIR and SIS
models.NA in which case the group 1 rate, b.rate,
governs the birth procesSIR model types.act.rate to the rate set for group 1 (with
balance="g1") or group 2 (with
balance="g2"). Further details provided below.TRUE, use a stochastic recovery
model, with the number of recovered a random draw from a
Poisson distribution for the product of the recovery rate
and the number infected. If FALSE, then a
deterministic rounded count oTRUE, use a stochastic birth
model, with the number of new births a random draw from a
Poisson distribution for the product of the birth rate
and population size. If FALSE, then a
deterministic rounded count of that prTRUE, use a stochastic mortality
model, with the number of new deaths a random draw from a
Poisson distribution for the product of the
state-specific death rates and the state size. If
FALSE, then a deterministic roundepiICM
with the following elements: nruns=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.nruns=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.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$.
epiICM function is a stochastic, discrete-time
representation of the deterministic compartmental disease
models that may be solved with epiDCM. Random
variation is simulated in all transition processes:
infection, recovery, and vital dynamics. The stochasticity
in each transition except infection may be toggled on or
off using the control parameters rec.rand,
b.rand, and d.rand.One important caveat is the current parameter structure of
specifing initial state sizes and individual parameters as
primary epiICM parameters will be deprecated in the
EpiModel v1.0 release. More flexibile passing of
model behavior and parameters will be implemented.
plot.epiICM, summary.epiICM,
as.data.frame.epiICM# SI Model
mod <- epiICM(type="SI", s.num=500, i.num=1,
trans.rate=0.2, act.rate=0.25, nsteps=500, nsims=10)
plot(mod)
# SIR Model
mod <- epiICM(type="SIR", s.num=500, i.num=1,
trans.rate=0.2, act.rate=0.25, rec.rate=1/50,
nsteps=500, nsims=10)
plot(mod, y="r.num", sim.lines=TRUE, sim.alpha=0.25)
# SIS Model
mod <- epiICM(type="SIS", s.num=500, i.num=1,
trans.rate=0.2, act.rate=0.25, rec.rate=1/50,
nsteps=500, nsims=10)
plot(mod, sim.lines=T, qnts=FALSE, sim.col=c("steelblue", "red"),
leg.cex=0.75, popfrac=FALSE)Run the code above in your browser using DataLab