Math Modelling Versus Machine Learning for COVID-19
By: Col Jung
Tags: Machine Learning, Data Science, Science, Programming, Mathematics

SIR Model

The classic three-compartment SIR model — created by Kermack and McKendrick in — has been the de facto standard basis model in epidemiology since the 1920's.

Like the logistic model, we’ve got compartments for susceptible and infected people, in addition to a new compartment that represents recovery. These correspond to a system of three ODEs.

The infected population I transmits the disease to the susceptible population S at some transmission rate β. These mechanisms are identical to the logistic model. Moreover, we assume the infected population automatically recover at some rate γ. (This part is the enhancement over the logistic model.)

Let’s numerically solve the ODEs and plot the solutions. Again, I used Python and added some extra labels in Illustrator.

Herd Immunity

The infection peaks at around the 68 day mark. This also coincides with the Herd Immunity Threshold. Here, the competition between the virus for fresh victims becomes overheated as many have already recovered and become immune. As a result, the infected curve begins declining and public health officials can sigh a breath of relief.

Rushing for herd immunity was a strategy considered by some governments early in the pandemic. The idea was to let the virus have a field day in the population, get enough people resistant ASAP and choke the viral spread to early defeat. Almost all governments abandoned this plan because of two key risks. First, a lot of bloody people were going to die while society tried to reach herd immunity. Second, scientists didn’t know whether there was long-lasting immunity to SARS-CoV-19. Turns out, there wasn’t.

Basic Reproduction Number and Flattening the Curve

Another key number on everyone’s mind was how many people (on average) did each COVID-infectee transmit the virus too. This is the Basic Reproductive Number R0.

Here’s a diagram explaining the spread dynamics would work for a R0 = 2 disease.

When R0 is greater than 1, the disease will continue to spread. When we can suppress R0 below 1, we know we’re on the path to victory. Intervention methods like social distancing, lockdowns and wearing masks help achieve this.

In the SIR model, the basic reproduction number is

For example, if the transmission rate β is 0.2 and the recovery rate γ was 0.1, then each day the number of infected people grows at twice the rate that’s recovering, hence R0 = 0.2/0.1 = 2. Hence on average, each infected person converts 2 susceptible people into being infected people.

Towards the beginning of the epidemic, squashing R0 down below 1 is too far of a pipe dream. Instead, the objective is to suppress it down far enough through intervention so that the epidemic doesn’t overwhelm the health system. This is known as flattening the curve.

For the SIR model, I’ve simulated the infection numbers for R0 = 2, 3 and 4 and plotted the corresponding curves.

For each city and region around the world, local health systems can only handle so many COVID-19 patients before running out of ICU beds, ventilators and medical personnel.

At the early stages of the pandemic, these healthcare capacity thresholds (purple line) were determined by public health agencies. Modellers were brought in to speedily inform how much intervention (social distancing, masks, lockdowns) were needed to flatten that dreaded curve below the threshold.

Some places flattened their curves incredibly well: Australia, China, Taiwan and South Korea, are some notable examples.