The Model
Model Overview
This model tracks susceptibles, exposed/pre-symptomatic, infected/symptomatic and recovered hosts. The following compartments are included:
- S - uninfected and susceptible individuals
- E - individuals who are infected and do not yet show symptoms. Those individuals can be infectious.
- I - individuals who are infected and show symptoms. Those individuals are likely infectious, but the model allows to adjust this, including no infectiousness.
- R - recovered/removed individuals. Those individuals have recovered and are immune. They can lose their immunity.
The included processes/mechanisms are the following:
- Susceptible individuals (S) can become infected by pre-symptomatic/exposed (E) or symptomatic (I) hosts at rates bE and bI.
- All infected hosts first enter the exposed/presymptomatic stage and leave the stage at rate gE, the inverse of which is the average time spent in this stage.
- All infected hosts go from the presymptomatic to the symptomatic stage and leave the stage at rate gI.
- Recovered individuals are initially immune to reinfection. They can lose their immunity at rate w and return to the susceptible compartment.
- New susceptible hosts enter the system (are born) at fixed rate m. Natural death occurs at rate n.
Model Implementation
The flow diagram for the model implemented in this app is:
Note that this model is not an ordinary differential equation model. It is instead its stochastic equivalent. We can specify the model by writing down every possible transition/event/reaction that can occur and their propensities (the propensity multiplied with the time step gives the probability that a given event/transition occurs). For our model these are the following:
Infection |
S => S-1, E => E+1 |
S(bEE+bII) |
Progression to Symptoms |
E => E-1, I => I+1 |
gEE |
Recovery |
I => I-1, R => R+1 |
gII |
Waning of Immunity |
R => R-1, S => S+1 |
wR |
Births |
S => S+1 |
m |
Death of susceptible |
S => S-1 |
nS |
Death of exposed |
E => E-1 |
nE |
Death of symptomatic |
I => I-1 |
nI |
Death of recovered |
R => R-1 |
nR |
What to do
The tasks below are described in a way that assumes everything is in units of MONTHS (rate parameters, therefore, have units of inverse months). If any quantity is not given in those units, you need to convert it first (e.g. if it says a year, you need to convert it to 12 months).
Some of the simulations might take a few seconds to run. Be patient.
Task 1:
- Set the model parameters such that it corresponds to the following setting:
- 1000 susceptible and 1 initially symptomatic host.
- Simulation duration approximately 5 years.
- Assume that only symptomatic individuals transmit, at rate 0.002.
- Assume that the duration of the symptomatic period is 1 month long, the duration of the presymptomatic period is half a month long.
- Assume immunity does not wane and that there are no births and deaths.
- Set the number of simulations to 1.
- With parameters set to correspond to the scenario just described, run the simulation.
- If you rerun the simulation without changing anything, what do you expect to see? Test your expectations by running the simulation several times.
- To speed things up, set the number of simulations to 20, run all 20.
Task 2:
- In the previous task, you should have seen that occasionally, no outbreak occurs (because the infected person recovers/dies before they can infect others). Explore how the initial number of infected influences the chance of (not) getting outbreaks. Set the initial number of infected to 5, everything as above.
- Run 20 outbreaks at a time, repeat a few times. Observe the number of times you do (not) get an outbreak.
- Repeat with the initial number of infected at 2,3, and 10.
Task 3:
- Set everything as in task 1, with 1 initial infected. Now explore how the rate of transmission (and with it the reproductive number) affects outbreaks.
- Try values for the transmission rate of 0.001, 0.0015 and 0.004. Compare the results.
Task 4:
- Set susceptibles to 400, infected to 100, the rate of immunity loss to 0.2, the rate of symptomatic transmission to 0.005, and no presymptomatic transmission.
- Set the duration of the symptomatic period to 1 month and the duration of the presymptomatic period to half a month.
- Simulation time about 5 years.
- No births and deaths.
- Set the number of simulations to 1. Run the model several times.
- You should see the stochastic version of a steady state, namely S-E-I-R values that fluctuate around some level.
Task 5:
- Record the fraction of susceptibles at the end of the simulation for the setting you just had. They will change.
- Now change the number of simulations to 5, 10, 20 (be patient). See how the average number of susceptibles at the end of the simulation settles down to some number. It will still fluctuate a bit, but as you take the average of more simulations, results become more stable (deterministic).
Task 6:
- Set simulation number to 5, rest as before.
- Run the model a few times for around 50 years (be patient). Observe if/when you get extinctions.
- Now change the rate of transmission to 0.003, again run multiple simulations, then repeat with transmission at 0.0025.
- Contemplate why you see what you see.
Task 7:
- Keep exploring. Turn on births and deaths. Play around with anything else you can think of.