DSAIDE - Dynamical Systems Approach to Infectious Disease Epidemiology

A collection of Shiny/R Apps to explore and simulate the population dynamics of infectious diseases.
Written and maintained by Andreas Handel, with contributions from others.

ID Dynamics Introduction - Practice

Overview

This app allows exploration of a very basic infectious disease simulation. The main goal is to get you familiar with the overall setup and ideas behind using these simulations, and how to run them. Read about the model in the “Model” tab. Then do the tasks described in the “What to do” tab.

The Model

Model Overview

This model is a compartmental SIR model. Compartmental means that we place individuals into distinct compartments, according to some characteristics. We then only track the total number of individuals in each of these compartments. In the simplest model, the only characteristic we track is a person’s infection status. We allow for 3 different stages/compartments:

The SIR model is very basic. It could be extendend by introducing further compartments. For instance we could stratify according to gender, which would give us 2 sets of SIR compartments, one for males and one for females. Some of these extensions are implemented in some of the other apps.

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

For our system, we specify only 2 processes/flows:

  1. A susceptible individual (S) can become infected by an infectious individual (I) at some rate (which is usually labeled b or \(\beta\)). This leads to the susceptible individual leaving the S compartment and entering the I compartment.
  2. An infected individual dies or recovers and enters the recovered/removed (R) compartment at some rate (often labeled as \(\gamma\)).

As with the compartments, we can extend the model and allow other processes to occur. For instance we could allow for natural births and deaths, waning immunity, deaths due to disease, etc. We will do that soon. For now, we keep the model as simple as possible.

Model Implementation

To allow us to simulate and study this model, we need to implement it on the computer. For that purpose, it is often useful to write the model as mathematical equations (this is not strictly needed, some computer simluation models are never formulated as mathematical models). One way to formulate the simple SIR model is with a set of ordinary differential equations. Each compartment/variable gets an equation. The right side of each equations specifies the processes going on in the system and how they change the numbers in each compartment via inflows and outflows. For the model described above, the equations look like this:

\[\dot S = -\beta SI\] \[\dot I = \beta S I - \gamma I\] \[\dot R = \gamma I\]

Since not everyone likes equations :) a very good way to describe compartmental models is by showing a flow diagram. Such a diagram consists of a box for each compartment, and arrows pointing in and out of boxes to describe flows and interactions. For the simple SIR model, the flow diagram looks as follows:

Flow diagram for simple SIR model.

Flow diagram for simple SIR model.

Some notes

What to do

Task 1:

Task 2:

Task 3:

Task 4:

Task 5:

Further Information

References

Keeling, Matt J, and Pejman Rohani. 2008. Modeling Infectious Diseases in Humans and Animals. Princeton University Press.

Vynnycky, Emilia, and Richard White. 2010. An Introduction to Infectious Disease Modelling. Oxford University Press.


This package is built and maintained by Andreas Handel, with contributions from others.
All text and figures are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Software/Code is licensed under GPL-3.