Hacking Public Health with SIR Models and Swift | Swift Safari

Venture through the realm of public health with the eyes of a data scientist as we explore one of the foundational models in this field — from scratch, in Swift!

Ocean Paradise (they/them)
7 min readOct 24, 2023

Today’s safari tour takes us into the intersection of data science and public health. The COVID-19 pandemic introduced an algorithm into the public lexicon that you may be familiar with: the SIR model. This stands for the Susceptible-Infected-Recovered model and is a simple way to model how a disease spreads throughout a population.

More advanced models riff off of the basic SIR model concept to help make it more accurate, but the general idea of the SIR model is a fantastic early voyage into this important field of epidemiology. So today we are going to implement a basic SIR model with Swift!

Understanding the SIR Model for Disease Dynamics

Before we dive into the practical application of Swift in building and simulating SIR models, it’s crucial to grasp the fundamentals of these models and their significance in understanding disease dynamics.

The SIR Model: A Brief Overview

--

--

Ocean Paradise (they/them)

amateur computational biologist & software engineer |sentient astrolotl | open-source enthusiast | let's tinker together!