
Last chance! 50% off unlimited learning
Sale ends in
Create an SEIR model to be used by the simulation framework.
SEIR(u0, tspan, events = NULL, beta = NULL, epsilon = NULL, gamma = NULL)
A data.frame
with the initial state in each node
(see ‘Details’).
A vector (length >= 1) of increasing time points
where the state of each node is to be returned. Can be either
an integer
or a Date
vector. A Date
vector is coerced to a numeric vector as days, where
tspan[1]
becomes the day of the year of the first year
of tspan
. The dates are added as names to the numeric
vector.
a data.frame
with the scheduled events, see
SimInf_model
.
The transmission rate from susceptible to exposed.
The incubation rate from exposed to infected.
The recovery rate from infected to recovered.
SEIR
The SEIR model contains four compartments; number of susceptible (S), number of exposed (E) (those who have been infected but are not yet infectious), number of infectious (I), and number of recovered (R). Moreover, it has three state transitions,
where
The argument u0
must be a data.frame
with one row for
each node with the following columns:
The number of sucsceptible in each node
The number of exposed in each node
The number of infected in each node
The number of recovered in each node
# NOT RUN {
## Create a SEIR model object.
model <- SEIR(u0 = data.frame(S = 99, E = 0, I = 1, R = 0),
tspan = 1:100,
beta = 0.16,
epsilon = 0.25,
gamma = 0.077)
## Run the SEIR model and plot the result.
set.seed(3)
result <- run(model)
plot(result)
# }
Run the code above in your browser using DataLab