| ModelSIR {epiworldR} | R Documentation |
SIR model
Description
SIR model
Usage
ModelSIR(name, prevalence, transmission_rate, recovery_rate)
## S3 method for class 'epiworld_sir'
plot(x, main = get_name(x), ...)
Arguments
name |
String. Name of the virus |
prevalence |
Double. Initial proportion of individuals with the virus. |
transmission_rate |
Numeric scalar between 0 and 1. Virus's rate of infection. |
recovery_rate |
Numeric scalar between 0 and 1. Rate of recovery_rate from virus. |
x |
Object of class SIR. |
main |
Title of the plot |
... |
Additional arguments passed to graphics::plot. |
Details
The initial_states function allows the user to set the initial state of the model. In particular, the user can specify how many of the non-infected agents have been removed at the beginning of the simulation.
Value
The
ModelSIRfunction returns a model of class epiworld_model.
The
plotfunction returns a plot of the SIR model of class epiworld_model.
See Also
epiworld-methods
Other Models:
ModelDiffNet(),
ModelSEIR(),
ModelSEIRCONN(),
ModelSEIRD(),
ModelSEIRDCONN(),
ModelSIRCONN(),
ModelSIRD(),
ModelSIRDCONN(),
ModelSIRLogit(),
ModelSIS(),
ModelSISD(),
ModelSURV(),
epiworld-data
Examples
model_sir <- ModelSIR(name = "COVID-19", prevalence = 0.01,
transmission_rate = 0.9, recovery_rate = 0.1)
# Adding a small world population
agents_smallworld(
model_sir,
n = 1000,
k = 5,
d = FALSE,
p = .01
)
# Running and printing
run(model_sir, ndays = 100, seed = 1912)
model_sir
# Plotting
plot(model_sir)