Description Usage Arguments Details Value See Also Examples
Simulates stochastic individual contact epidemic models for infectious disease.
1  icm(param, init, control)

param 
Model parameters, as an object of class 
init 
Initial conditions, as an object of class 
control 
Control settings, as an object of class

Individual contact models are intended to be the stochastic microsimulation analogs to deterministic compartmental models. ICMs simulate disease spread on individual agents in discrete time as a function of processes with stochastic variation. The stochasticity is inherent in all transition processes: infection, recovery, and demographics. A detailed description of these models may be found in the Basic ICMs tutorial.
The icm
function performs modeling of both the base model types
and original models. Base model types include onegroup and twogroup
models with disease types for SusceptibleInfected (SI),
SusceptibleInfectedRecovered (SIR), and SusceptibleInfectedSusceptible (SIS).
Original models may be built by writing new process modules that either take
the place of existing modules (for example, disease recovery), or supplement
the set of existing processes with a new one contained in an original module.
A list of class icm
with the following elements:
param: the epidemic parameters passed into the model through
param
, with additional parameters added as necessary.
control: the control settings passed into the model through
control
, with additional controls added as necessary.
epi: a list of data frames, one for each epidemiological output from the model. Outputs for base models always include the size of each compartment, as well as flows in, out of, and between compartments.
Extract the model results with as.data.frame.icm
.
Summarize the timespecific model results with summary.icm
.
Plot the model results with plot.icm
. Plot a compartment flow
diagram with comp_plot
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39  ## Not run:
## Example 1: SI Model
param < param.icm(inf.prob = 0.2, act.rate = 0.25)
init < init.icm(s.num = 500, i.num = 1)
control < control.icm(type = "SI", nsteps = 500, nsims = 10)
mod1 < icm(param, init, control)
mod1
plot(mod1)
## Example 2: SIR Model
param < param.icm(inf.prob = 0.2, act.rate = 0.25, rec.rate = 1/50)
init < init.icm(s.num = 500, i.num = 1, r.num = 0)
control < control.icm(type = "SIR", nsteps = 500, nsims = 10)
mod2 < icm(param, init, control)
mod2
plot(mod2)
## Example 3: SIS Model
param < param.icm(inf.prob = 0.2, act.rate = 0.25, rec.rate = 1/50)
init < init.icm(s.num = 500, i.num = 1)
control < control.icm(type = "SIS", nsteps = 500, nsims = 10)
mod3 < icm(param, init, control)
mod3
plot(mod3)
## Example 4: SI Model with Vital Dynamics (TwoGroup)
param < param.icm(inf.prob = 0.4, inf.prob.g2 = 0.1,
act.rate = 0.25, balance = "g1",
a.rate = 1/100, a.rate.g2 = NA,
ds.rate = 1/100, ds.rate.g2 = 1/100,
di.rate = 1/50, di.rate.g2 = 1/50)
init < init.icm(s.num = 500, i.num = 1,
s.num.g2 = 500, i.num.g2 = 0)
control < control.icm(type = "SI", nsteps = 500, nsims = 10)
mod4 < icm(param, init, control)
mod4
plot(mod4)
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.