SEIR.simulator(M, N, beta, ki, thetai, ke=ki, thetae=thetai,
latencydist="fixed", latencyperiod=0)
buildER
. Randomly chooses an initial infective
individual. The infection spreads randomly across edges in the
network according to exponential infective periods with mean $\frac{1}{beta}$.
An infective individual remains in the exposed state for a either
a fixed period of time given by latencyperiod or a time described by a
gamma RV with parameters ke and thetae (mean = $ke \cdot thetae$,
var = $ke \cdot thetae^2$). After this exposed period, an infected person
moves to the Infected state, at which point they can infect susceptible individuals.
The infective individuals are removed after an infective period whose length is governed by
a gamma RV with parameters ki and thetai (mean = $ki \cdot thetai$,
var = $ki \cdot thetai^2$). Once an individual is removed, they cannot be
re-infected and cannot infect others.# Simulate an epidemic through a network of 30
set.seed(1)
examplenet <- buildER(30,0.1)
exampleepidemic <- SEIR.simulator(examplenet,30,0.3,2,5,latencydist="gamma")
Run the code above in your browser using DataLab