A shiny app which allows the exploration of the dynamics of a range of simple infectious disease models
R JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Explore Infectious Disease Models

This shiny app has been developed to allow the exploration of the parameter space of compartmental infectious disease models. It is designed to be used as a teaching aid when introducing people to the concepts behind infectious disease models without requiring them to interact with the underlying code. A number of infectious disease models are included, such as a Susceptible, Exposed, Infected, Recovered model the flow diagram for which can be seen below.

A susceptible, exposed, infected, recovered model.

A susceptible, exposed, infected, recovered model.

An example of a more complex model for Tuberculosis is also included,

A complex model of Tuberculosis, including reinfection, multiple latent compartments, risk groups and treatment.

A complex model of Tuberculosis, including reinfection, multiple latent compartments, risk groups and treatment.

This includes a risk group, high and low risk latent states, reinfection for those who have recovered from active disease or are latently infected, and treatment. The impact of demographic processes are explored in all models. The code for each model can be viewed in the application.

Using the app

  • Click on the Explore Model Dynamics Tab in the menu on the left hand side. You should see this,

  • Select a model of interest, demographic processes can be toggled on or off. Click on the run model simulation button to simulate the model.

  • Explore the parameter space of the model using the provided sliders. A summary table of the model simulation is provided as are the raw simulation results. Show the previous model simulation using the previous model run slider. The model output can also be shown separately for each compartment using the plot compartments separately slider.

Running the App Locally

The app can be run directly from GitHub. Open R and run the following;

shiny::runGitHub("exploreidmodels", "seabbs")


Manual Install

To install and run the shiny app locally on your own computer you will need to first install R, it is also suggested that you install Rstudio. After downloading the source code from this repository click on the exploreidmodels.Rprof file, this will open an Rstudio window. Type the following code into the command line;


To run the app open the ui.R file and press run, depending on your computer this may take some time.

Using Docker

Docker is a container software that seeks to eliminate "works on my machine" issues. For installation and set up instructions see here.

This docker container is based on the tidyverse docker image, see here for instructions on use. To run the docker image run the following in a bash shell:

docker pull seabbs/exploreidmodels
docker run --rm -p 8787:8787 -e USER=exploreidmdoels -e PASSWORD=exploreidmodels --name exploreidmodels seabbs/exploreidmodels

The Rstudio server can be found on port :8787 at your local machines ip (or localhost on windows).