question id: using-SIR-1
142Z Project 2: Dynamics
Using the SIR Model
In this project you will work with a differential equation model of the spread of contagious disease in order to make sense of the past, the prognosis of the COVID pandemic, and to examine the impact of policies such as social distancing and vaccination.
The model we will use and develop is called the SIR-model. The name reflects the three population groups at the core of the model: people susceptible to infection, people who are currently infective, and people who had the disease but are no longer infective, the so-called recovered group. That we implement the model using differential equations should in no way be interpreted as our having captured in detail the real-world mechanisms of contagion. The SIR model can at best make only rough, tentative approximations to the future course of an epidemic. There are many important phenomena completely outside the scope of the model, such as the evolution of new variants of the virus, the role of super-spreader events, and so on. That being said these SIR-models are commonly used including by the Pandemic Math Team which helps model the pandemic at USAFA and has served as a standard for the pandemic response across the Air Force.
The utility of the model is not for detailed prediction. Instead, the model provides
- a framework for translating limited information from various sources into a format that can be compared to typical (incomplete) records of disease spread over time
- estimates of the population fraction who remain susceptible at the end of an outbreak and how this might be influenced by various public-health interventions
- information about the possibility of the disease becoming endemic, that is, a permanent feature of the environment
The model, like many others weβve seen, consists of a state that describes the instantaneous βpositionβ of the system and dynamical rules that describe the instantaneous rate of change of the state as a function of the state itself. In constructing the dynamical rules, weβll take note of an appropriate time scale, and weβll follow the pattern of using parsimonious, low-order polynomials.
Weβll imagine the state as consisting of the number of people in three different compartments:
- people who are susceptible
- people who are currently infective
- people who are neither susceptible or infective, who we lump under the name βrecoveredβ
.
The dynamical rules describe the rates at which people move from one compartment to another. Those flows are rooted in some basic, everyday biology:
- contact between infective and susceptible people will, at some level of probability, convert a susceptible into an infective.
- after a characteristic amount of time, infective people no longer remain infective and enter the βrecoveredβ compartment.
Schematically, the flows are one-way only:
Susceptible
Other patterns of flow might be appropriate depending on the circumstances. For instance, at the time of writing (March 2021) there is uncertainty whether those recovered from COVID might at some time regain susceptibility. Another sort of flow is evidenced by a very recent Ebola transmission traced to a person who had again become infective after recovering five years previously. In some diseasesβherpes, malariaβpeople can be latent carriers whose infectiveness comes and goes over periods of month or years.
With COVID, we have seen large scale changes in the number of sick on a time scale of months or seasons. Since overall population changes little on that time scale, we start with an assumption that the model does not have to incorporate birth rates.
Now to describe the dynamics in a population of size
The susceptible compartment has no inward flow. The outward flow is governed by the interaction between susceptibles and infectives. This gives simply
Whatβs the
Hardly any of these potential meetings ever happens. And even if a meeting does happen, it will not necessarily lead to the susceptible becoming infective. All of this is meant to be captured by the parameter
The infective compartment has a flow in and another flow out. The flow in is exactly those same people who flowed out of the susceptible compartment, the rate of which is
Finally, the
Only two unknown parameters:
Estimating
At the start of the pandemic, the Centers for Disease Control and other public health organization recommended that people who tested positive for COVID, or those in close contact with someone who tested positive, isolate themselves for two weeks.
Letβs reverse-engineer
Essay 1: State what you think is a βvery small probabilityβ might be and explain what that probability means in the context of this problem (For instance, if X number of people become infected and quarantined, we would expect Y number of people to still be in state I at the end of two weeks).
Essay 2: (Give a short answer.) Assume the very small probability through experimental trials is 0.1% after two weeks. What is the corresponding
- What are the appropriate units for
?
Estimating
To estimate
Imagine a region containing
Near the start of the epidemic, almost everyone is susceptible and there is just a small number of infectives or recovered. So we can treat
The dynamics of
For a doubling time of about 20 days in the beginning, when
Essay 3: Based upon your previous answer for
- What are the appropriate units for
? (Assume that , the population size has units of persons.)
people/day
days/person
1/persons
1/days
1/(person-days)
question id: using-SIR-2
Essay 4: Explain how you know the units for
Running the model
Having estimated the parameters
Here are the differential equations and the commands for numerical integration. The parameters have been set up so that you need only specify your value for
Two quantities are of particular interest in public health: the fraction of the population that falls ill and the peak rate of new infection. The latter is relevant to the peak load on the medical system. The former indicates how likely a βaverageβ person is to get the disease at some point in the outbreak. You can read both these quantities off the graphs.
The peak rate of infection and the population fraction are presumably related to the parameters
Essay 5: How does halving the quantity βdoubling timeβ affect the population fraction? Ensure you have the value for alpha that you calculated to start in the code.
Essay 6: How does doubling the quantity βdoubling timeβ affect the peak infection rate?
Essay 7: How does doubling the quantity βrecovery rateβ affect the population fraction? Ensure your doubling rate has been returned to a value of 20.
Essay 8: How does halving the quantity βrecovery rateβ affect the peak infection rate?
For the previous answers you should use your calculated beta <-
your number in place of the existing calculation of
Essay 9: Describe how that doubling of
Intervening
Many different forms of public-health interventions are available, e.g. mask wearing, closing businesses or schools, vaccination. In terms of the model, these all come down to adjusting the values of the parameters
For instance, the effect of social distancing might be modeled by increasing the doubling time for transmission. Vaccination could be modeled by moving people from the
Essay 10: Suppose at the start of the epidemic you could vaccinate 70% of the population with a vaccine that is only 50% effective. Run the model to find out how would this change the population fraction and peak infection rate. Your answer should be supported by numbers and not simply be guesses about what would occur.
Essay 11: [Short Answer] Herd immunity refers to a situation where the number of infectives does not grow. Try moving various fractions of the population from
Another way to intervene is to change
One of the strategies used in China to contain the outbreak in March and April 2020 was to isolate infectives. Voluntarily or not, those with a positive COVID test were removed from their families and placed in hospitals, some of which had been specially constructed at short notice. Widespread, rapid testing and response can also help to reduce the time that an infective is in contact with susceptibles.
Essay 12: Would sequestering infectives correspond to an increase in
An endemic future?
A feature of the SIR model as stated here is that the rate of new infectives eventually falls to zero; the outbreak comes to an end. In the real world, however, diseases can become endemic, meaning that there is always a background rate of new infections that can smolder until such time as the susceptible population recovers. One mechanism for this is births. The classic childhood illnesses of your grandparentsβ timeβmeasles, mumps, rubella, even polioβwere endemic and new outbreaks would occur as the number of susceptible children accumulated over years.
Letβs explore another possibility about which there has been considerable speculation. Imagine that βrecoveredβ people regain their susceptibility at a low rate, perhaps over the course of a year or more.
This would change the
- What are the appropriate units for
?
people/day
days/person
1/persons
1/days
1/(person-days)
question id: using-SIR-3
Essay 13: Explain how an endemic state would show up in the graph of
Congratulations on finishing the project! The R code below will help you play around with the model to understand even more.
Objectives
MAKE THE PROJECT ABOUT THE DYNAMICS OF NEWTONβS METHOD, Maybe about zero-finding and optimization on functions of two variables.
Raw material that was previously an exercise.
Last semester we introduced an iterative technique for finding the zeros of a function
We can use this method to find, for instance,
Finding
Weβve called the dynamics function
Start with a very rough guess for
Using Active R chunk 2, implement the function
- Using
as the dynamics and starting with , what is ?
question id: newtons-method-1
- Modify
N()
in Active R chunk 2 to find . Starting at , how many times do you have to apply your newN()
to get an answer right to within 1% of the true number?
After 2 steps we get 4.202
After 3 steps we get 4.713.
After 3 steps we get 4.472.
After 4 steps we get 4.472.
After 4 steps we get 4.478.
question id: newtons-method-2
- Modify your
N()
once again to find . (That is, the cube-root of 10.) Starting at , take 3 Newton steps. What is ?
2.154
2.320
2.875
2.912
question id: newtons-method-3