Skip to content

dotSlashJack/SIR-shiny-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

SIR Modeling Tool

Visualize SIR time series data with a Shiny app

By Jack Hester, Emma Dennis-Knieriem, and Emily Nomura

Overview

This Shiny app presents a visual representation of a simple SIR model's dynamics over time. The plot models susceptible (S), infected (I), and recovered (R) populations over time. The input parameters, β, ν, 𝑁, and initial # infectious, can be changed by the user with sliders. Our model assumes homogeneous, random mixing and does not take births, deaths, pre-infectious and latent periods, or any other demographics into account. More information on SIR models can be found here.

The mathematical model

The SIR model is based on the following set of differential equations:

Our model treats one day as a single time step.

Usage

To use this app, you can visit https://jack-hester.shinyapps.io/sir-shiny-app/. You can also run it locally and modify the code by downloading and running app.r.

User Inputs

Our app updates the number of individuals in the susceptible, infected, and recovered groups over time based on the user-provided parameters mentioned above. The app also allows users to download a CSV that contains the number in each category at each time step.

The user-provided inputs are:

  1. β, the "flow rate" of individuals from susceptible to infected. In our model specifically, it represents the rate at which two individuals come into contact with each other.

  2. ν, the "flow rate" at which the rate at which individuals recover (infected to recovered)

  3. 𝑁, the initial population size (number of individuals)

  4. The initial number of infected (infectious) individuals

Displaying Results

Results are displayed as a plot of the number of susceptible, infected, and recovered individuals over time (up to 100 days later). We also allow users to download a csv containing the number of individuals in each of these categories at each time step (day zero to 100, inclusive).

Limitations

The model only shows the first 100 days worth of data. Our model is based on a simple SIR model; it does not take natural births or deaths, geography, differential susceptibility, latent periods, or any other cohort-specific factors. If you want to add any of these features, you are welcome and encouraged to download and alter this code.

Acknowledgements

Thank you to Dr. Alice Paul for her assistance with developing this code.

Contact

Primary contact email: jack_hester [at] brown [dot] edu

About

Shiny app for SIR modeling

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages