# Reproductive Number 2 - Practice

## Overview

This app covers more aspects of the reproductive number concept. Read about the model in the “Model” tab. Then do the tasks described in the “What to do” tab. If you are not familiar with the reproductive number, you should go through the ‘Reproductive Number 1’ app first.

This app also assumes that you have worked through the apps in the The Basics section.

### Learning Objectives

- Know how to estimate the reproductive number from steady state levels of disease.
- Understand how the reproductive number can be used to parameterize models.

## The Model

### Model Overview

For this app, we’ll use a basic compartmental SIR model that also includes births, deaths and waning immunity. We allow for 3 different stages/compartments:

- S - uninfected and susceptible individuals
- I - infected and infectious individuals (note that these terms are often used interchangeably, but technically we are talking about someone who is infected and is infectious, i.e. can infect others)
- R - recovered/removed individuals.

In addition to specifying the compartments of a model, we need to specify the dynamics determining the changes for each compartment. Broadly speaking, some processes increase the number of individuals in a given compartment/stage and other processes that lead to a reduction. Those processes are sometimes called inflows and outflows.

For our system, we specify the following processes/flows:

- Susceptible individuals (S) can become infected by infectious individuals (I) at some rate, b. This leads to the susceptible individual leaving the S compartment and entering the I compartment.
- Infected individuals recover and enter the recovered (R) compartment at some rate, g.
- Recovered individuals can lose immunity at rate w and return to the susceptible compartment.
- Natural births (into the S compartment at rate n) and deaths (from all compartments at rate m) are possible.

### Model Implementation

The flow diagram and the set of equations which are used to implement this model are as follows:

Model Diagram

\[\dot S =n - b SI - mS + wR\] \[\dot I = b S I - g I - mI\] \[\dot R = g I - mR - wR\]

### Reproductive number

The app and tasks deal with the reproductive number concept. I recommend reading a bit more about it. I’m following the terminology of my own write-up. You can also check the books listed in the ID introduction app or some of the papers listed in the Further Resources section of this app.

In the Reproductive Number 1 app, we looked at how one can write down and equation for the reproductive number for the model used there. The model we use here is similar but not quite the same. We can use the basic definition to easily figure out the reproductive number. Recall that it is defined as the average number of new infected (and infectious) individuals caused by one infectious individual.

For the model shown above, one can figure the value out by determining how many new infections are caused by one infected person. A person is infectious for a duration of 1/(g+m), the inverse of all the outflows out of the compartment. During that time they infect others at rate b. Thus the average number of new infections during created in b/(g+m). For the whole population, assuming initially everyone is susceptible, we multiply by the number of initial susceptibles to get \[R_0=\frac{bS_0}{g+m}\]

## 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).

### Task 1

In Reproductive Number 1, the focus was on a single outbreak. But the reproductive number concept is also useful in situations where a disease is endemic. As you learned in the Patterns of ID app (if not, go do it before this one), to achieve an endemic state, we need replenishment of susceptibles through for instance births or waning immunity. We’ll start with natural births and deaths. If births (and deaths) are present, you will be able to get multiple outbreaks and endemic states. Set the parameter values such that your hosts have approximately an average lifespan of 41 years (remember to convert to months before taking the inverse). Round to the first significant digit (i.e. 0.00X). Set birth rate such that the population is steady at 1000 in the absence of any infected hosts (if you need a reminder how that’s done, revisit the ID Patterns app).

Now we’ll introduce the disease. Set simulation time to around 500 years, 1 infected, g=5, b=0.015. Run the simulation, make sure you reach a steady state. Compare the steady state values for S (and optional I and R) from the simulation with those predicted from the SIR steady state equations (see Patterns of ID app).

Record

- The value you used for birth rate

- Number susceptible at steady state

### Task 2

Figure out what the value for the reproductive number is at the endemic steady state. To that end, recall its definition (average number of new infectious persons created by one infectious person) and determine what has to be true if the number of infected neither increases nor decreases. How does that compare to the reproductive number at the peak of an outbreak, which you learned about before?

Record

- Value of R at endemic steady state

### Task 3

At steady state, you have the R value you just figured out in the previous task and a fraction of the population is susceptible, namely Sf / S0 where Sf is the number of susceptibles at steady state and S0 is the number of susceptibles at the beginning. You learned that the equation for the reproductive number for this model is R0=bS0/(g+m). Use it to compute the reproductive number. Compare the value of R0 at the start (where the fraction of susceptible is 1) with the value of the fraction of susceptible and the R value at steady state. Can you figure out how they relate? It should confirm what you figured out about R at steady state in the previous task.

Record

- Number susceptible left at steady state

- The value for R0

### Task 4

Next double the values for both natural birth and death rates. What do you get for the value of S at steady state? Is that surprising? If it is, take another look at the relation between R0 and S at steady state, and the equation for R0.

Record

- The value of S at steady state (end of simulation)

### Task 5

1. Turn off births and deaths and instead assume immunity wanes over 10 months (convert to a rate). Run the simulation with the same transmission rate and recovery rate as task 1. Record the value of S at steady state. How does it compare to the value from the previous task? Is that surprising? Again, look at the equation for R0.
2. Now double the initial number of susceptible. What is R0 now? What do you therefore expect for the number of susceptibles at steady state? Run the simulation to see what you get. If the numbers confuse you at first glance, think carefully about the relation between R0 and both number and fraction susceptible left at steady state. Also, compare what you find here with the way to get the steady state as discussed in Patterns of ID and revisited in task 1 above.

Record

- Number susceptible at steady state (A)

- Number susceptible at steady state (B)

### Task 6

One usually obtains R0 from the data/literature and uses it to pick values for the transmission parameter, b, which is otherwise very hard to estimate. Let’s try that. Go online and find (approximate) values for the duration of the infectious period and R0 for SARS. Start with 1000 susceptible, 1 infected. Assume that for a single outbreak we can ignore births, deaths or waning immunity (all zer0). Use those values and the R0 equation to compute the transmission parameter, b. Then run a simulation with that value for b (for 12 months). Recall from the Reproductive Number 1 app how you can use the fraction if suceptibles left at the end of an outbreak to compute R0. Do that here again to confirm that you get indeed (approximately) the value you started out with.

Record

- Nothing

### Task 7

Let’s repeat the same for a disease that causes an endemic state, tuberculosis (TB). Go online and find estimates for the basic reproductive number of TB. Note that TB is somewhat special: An infected and infectious person (someone with TB disease) might infect many others, but only some of those will go on to develop disease and become infectious. For R0, we always need to go from infectious individual to another infectious individual. Also find an estimate for the duration of the infectious period for TB. Then use these quantities to determine parameters b and g and run a simulation with 1000 susceptible and the same birth and death rates as in task 1 (m=0.002 and n=2). Check that the steady state levels of infected/infectious individuals matches with the R0 value you chose.

Note: The SIR model is not a good model for TB since for TB, the stage where individuals are infected but not yet infectious is long and important. So to really model TB, one would need to include such details. We are only using TB here for illustrative purposes.

Record

- Nothing

## Further Information

- This app (and all others) are structured such that the Shiny part (the graphical interface you see and the server-side function that goes with it) calls an underlying R script (or several) which runs the simulation for the model of interest and returns the results.
- For this app, the underlying function(s) running the simulation are called `simulate_SIRSd_model_ode`. You can call them directly, without going through the shiny app. Use the `help()` command for more information on how to use the functions directly. If you go that route, you need to use the results returned from this function and produce useful output (such as a plot) yourself.
- You can also download all simulator functions and modify them for your own purposes. Of course to modify these functions, you’ll need to do some coding.
- For examples on using the simulators directly and how to modify them, read the package vignette by typing `vignette('DSAIDE')` into the R console.
- For the equations mentioned in the tasks, see e.g. (Heffernan, Smith, and Wahl 2005; Keeling and Rohani 2007; Vynnycky and White 2010).
- For some information on the reproductive number, see e.g. (Fine, Eames, and Heymann 2011; Heffernan, Smith, and Wahl 2005; Roberts 2007; Wallinga and Lipsitch 2007).

### References

Fine, Paul, Ken Eames, and David L Heymann. 2011. “"Herd Immunity": A Rough Guide.” Clinical Infectious Diseases : An Official Publication of the Infectious Diseases Society of America 52 (7): 911–16. https://doi.org/10.1093/cid/cir007.
Heffernan, J M, R J Smith, and L M Wahl. 2005. “Perspectives on the Basic Reproductive Ratio.” Journal of the Royal Society, Interface / the Royal Society 2 (4): 281–93. https://doi.org/10.1098/rsif.2005.0042.
Keeling, Matt, and Pejman Rohani. 2007. Modeling Infectious Diseases in Humans and Animals. Princeton University Press.
Roberts, M. G. 2007. “The Pluses and Minuses of R0.” Journal of The Royal Society Interface 4 (16): 949–61. https://doi.org/10.1098/rsif.2007.1031.
Vynnycky, Emilia, and Richard White. 2010. An Introduction to Infectious Disease Modelling. Oxford University Press.
Wallinga, J, and M Lipsitch. 2007. “How Generation Intervals Shape the Relationship Between Growth Rates and Reproductive Numbers.” Proceedings. Biological Sciences / The Royal Society 274 (1609): 599–604. https://www.ncbi.nlm.nih.gov/pubmed/17476782.