| Download
All published worksheets from http://sagenb.org
Project: sagenb.org published worksheets
Views: 168740Image: ubuntu2004
Reed-Frost epidemic model
In this stochastic model, there are three classes of individuals: Susceptible, Infected, and Recovered (or Removed). At each time step, susceptible individuals are infected by one of the infected individuals with probability p. Infected individuals recover in one time step.
This demo plots the number of infected (red) and susceptible (blue) individuals over time. A histogram of final epidemic sizes (total number infected) is also shown. By default, the code plots the results of 10 stochastic runs. You can set the number of runs, p, and the initial number of susceptible and infected individuals.
Interact: please open in CoCalc