Closed Spatial-R closed 7 years ago
The latest version (v3.0.0) of SimInf on CRAN includes the SEIR and SIR models.
library("SimInf")
## Create an SIR model object.
model <- SIR(u0 = data.frame(S = 99, I = 1, R = 0),
tspan = 1:100,
beta = 0.16,
gamma = 0.077)
## Run the SIR model and plot the result.
result <- run(model, seed = 123)
plot(result)
## Create an 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.
result <- run(model, seed = 123)
plot(result)
Nice graphs!
Thanks for your development of the SimInf package, which provides several types of dynamic models such as SIS. In my situation, there is no transition from the Infectious compartment to the Susceptible compartment, there i need to modify the model setting in the package. My idea is:
But that way will influence the total number of population in all nodes. Is there any other ways can help to build the SIR model using SimInf?