# Characterizing Infection States - Documentation

## Overview

This app allows you to explore a model that has several more compartments than the basic SIR model discussed in the Introduction to ID app. Read about the model in the “Model” tab. Then do the tasks described in the “What to do” tab.

## The Model

### Model Overview

In the Introduction to ID app, you explored a simple 3-compartment model, the basic SIR model. The model for this app has a few additional compartments, which allows us to include more details/realism into our model. We again focus on tracking individuals with regard to their infection/disease status. For this model, we track the following compartments/stages:

- S - susceptible, uninfected individuals
- P - presymptomatic individuals who are infected and do not yet show symptoms. Those individuals can potentially be infectious.
- A - asymptomatic, infected individuals. Those individuals can potentially 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.
- D - individuals who have died due to the disease.

Of course, as with the basic SIR model, we could include further details by extending the number of compartments. In general, for each additional feature you want to track, the existing number of compartments needs to be replicated by the discrete categories you have. For gender, one would need to have 2x the compartments. Similarly if one wanted to stratify according to young/medium/old age, 3x the compartments are required, etc.

In addition to specifying the compartments of a model, we need to specify the dynamics determining the changes for each compartment. In general, more compartments leads to more processes and more parameters governing these processes.

For this model, we include the following processes:

- Susceptible individuals (S) can become infected by pre-symptomatic (P), asymptomatic (A) or symptomatic (I) hosts. Different types of infected individuals (P, A and I) transmit to other individuals and infect them at rates governed by the parameters, bP, bA, and bI. In other words, those bi parameters determine how infectious an individual in stages P, A and I is.
- All infected individuals first enter the presymptomatic stage. They remain there for some time (determined by rate gP, the inverse of which is the average time spent in the presymptomatic stage). A fraction f of presymptomatic hosts move into the asymptomatic category, and the rest become symptomatic infected hosts.
- Asymptomatic infected hosts recover after some time (specified by the rate gA).
- Similarly, infected symptomatic hosts leave that stage at rate gI. For symptomatic hosts, two outcomes are possible, either recovery or death. The parameter d determines the fraction of hosts that die.
- Recovered individuals are immune to reinfection.

### Model Implementation

The flow diagram and the set of ordinary differential equations (ODE) which are used to implement this model are as follows:

Model Diagram

\[\dot S = -S (b_P P + b_A A + b_I I)\] \[\dot P = S (b_P P + b_A A + b_I I) - g_P P\] \[\dot A = f g_P P - g_A A\] \[\dot I = (1-f) g_P P - g_I I\] \[\dot R = g_A A + (1-d) g_I I\] \[\dot D = d g_I I\]

## What to do

The tasks below are described in a way that assumes everything is in units of days (rate parameters, therefore, have units of inverse days). If any quantity is not given in those units, you need to convert it first (e.g. if it says a week, you need to convert it to 7 days).

### Task 1

Start with 1000 susceptibles, 1 initially infected presymptomatic host, P0, simulation duration of 200 days. Assume that only symptomatic individuals transmit, at rate bI = 0.001. Assume that the duration of the presymptomatic, asymptomatic and symptomatic periods are all 5 days long. (Hint: The parameters gP, gA, and gI are the inverses of these periods.) Assume that there are no asymptomatic infections, f=0, and nobody dies due to disease d=0. Make sure the results agree with model settings. For instance you shouldn’t get any deaths, and no asymptomatic infected. If you did it correctly, your outbreak should end with around 7 susceptibles remaining. From the graph, contemplate how you would estimate the day at which the outbreak peaks. What’s the problem? How would you solve it? Rerun the simulation, with the same input settings (i.e. don’t change anything, just hit the Run Simulation button again). Do you see any changes in the results? Why (not)? (This will be different once we move to the stochastic models).

Record

- Total number of recovered (at end of simulation)

- Number susceptible left at end of simulation

### Task 2

Assume now that after the pre-symptomatic stage, half of the infected move on to become symptomatic while the other half is asymptomatic. Set the model parameter controlling the fraction who become asymptomatic accordingly. Don’t change any other assumption. Do you expect to get a change in the outbreak size? Why? Compute the total number of infected as you did for the Basic SIR app. To do so, look at the diagram for the model and make sure you understand how individuals can flow through the system. That information will help you compute the total (cumulative) number infected (both symptomatic and asymptomatic).

Record

- Number susceptible left at end of simulation

- Total/cumulative number who got infected

### Task 3

Now assume that asymptomatic individuals transmit at the same rate as symptomatic individuals. Change bA accordingly. Leave everything else as before. How do you expect the results to change? (Try to make as precise/quantitative a prediction as you can). Compare your results to the first task and make sure you understand why you get the results you do.

Record

- Number recovered at end of simulation

- Number susceptible left at end of simulation

- Total deaths

### Task 4

Next, let’s assume that half the symptomatic infected die. Change the corresponding parameter in the model to reflect this new assumption. Leave everything else as in task 3. How do you expect the results to change?

Record

- Number of recovered at end of simulation

- Number susceptible left at end of simulation

- Total deaths

### Task 5

Set all 3 transmission parameters (bP, bA, and bI) to 0.0005, leave everything else as before. Note that this lowers the transmission rate of the asymptomatic and symptomatic groups by a factor of 2, but now pre-symptomatic individuals are also infectious. What do you expect will happen to the peak of P and I as well as the total number of individuals who got infected (i.e., R + D at the end of simulation), compared to the previous task?

Record

- Max number (peak) of pre-symptomatic (P)

- Max number (peak) of symptomatic infected (I)

- Number susceptible left at end of simulation

- Total deaths

### Task 6

Further explore how changes in the infectiousness of the different groups (bP, bA, bI) and the average time a person spends in each of those states (gP, gA, gI) affects the infection dynamics. Every time, think about what you expect to get, then run the simulation, compare your expectations with the results. Then make sense of it.

Record

- Nothing

### Task 7

Using the settings from task 5, but now assume that 90% of infections are asymptomatic. How do things change?

Record

- Max number of pre-symptomatic (P)

- Max number of symptomatic infected (I)

- Number susceptible left at end of simulation

- Total deaths

### Task 8

Further explore how changes in the fraction becoming asymptomatic and fraction dying does (or does not) affect the infection dynamics. Every time, think about what you expect to get, then run the simulation, compare your expectations with the results. Then make sense of it.

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_Characteristics_of_ID_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.
- Some further information covering the concepts this app addresses can be found in Milwid et al. (2016).

### References

Kajita, Emily, Justin T. Okano, Erin N. Bodine, Scott P. Layne, and Sally Blower. 2007. “Modelling an Outbreak of an Emerging Pathogen.” Nature Reviews Microbiology 5 (9): 700–709. https://doi.org/10.1038/nrmicro1660.
Keeling, Matt, and Pejman Rohani. 2007. Modeling Infectious Diseases in Humans and Animals. Princeton University Press.
Milwid, Rachael, Andreea Steriu, Julien Arino, Jane Heffernan, Ayaz Hyder, Dena Schanzer, Emma Gardner, et al. 2016. “Toward Standardizing a Lexicon of Infectious Disease Modeling Terms.” Frontiers in Public Health 4 (September). https://doi.org/10.3389/fpubh.2016.00213.
Vynnycky, Emilia, and Richard White. 2010. An Introduction to Infectious Disease Modelling. Oxford University Press.