Skip to contents

Susceptible-Infected-Susceptible model (SIS) (wiki)

Usage

ModelSIS(name, prevalence, transmission_rate, recovery_rate)

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 from virus.

Value

Examples

model_sis <- ModelSIS(name = "COVID-19", prevalence = 0.01,
  transmission_rate = 0.9, recovery_rate = 0.1)

# Adding a small world population
agents_smallworld(
  model_sis,
  n = 1000,
  k = 5,
  d = FALSE,
  p = .01
)

# Running and printing
run(model_sis, ndays = 100, seed = 1912)
#> _________________________________________________________________________
#> Running the model...
#> |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
model_sis
#> ________________________________________________________________________________
#> Susceptible-Infected-Susceptible (SIS)
#> It features 1000 agents, 1 virus(es), and 0 tool(s).
#> The model has 2 states.
#> The final distribution is: 99 Susceptible, and 901 Infected.

# Plotting
plot(model_sis, main = "SIS Model")