SIR models of disease spread
Thursday 7th May 2020
Back in March, when the UK lockdown was just beginning, I was tinkering with GeoGebra. As one does. I had been reminded of GeoGebra's ability to solve differential equations by Juan Carlos Ponce Campuzano, who tweeted a link to his awesome SIR model where GeoGebra did all the heavy lifting of solving the differential equations.
By coincidence, Brady Haran emailed me on 23rd March about other Numberphile projects, and mentioned that there was something of a 'deafening roar' for Numberphile to do a video about the virus spread. Both of us felt that it had been done to death by many people already, but we wondered if there was something quick and different that we could get done remotely.
The next day we had a stab at doing a live GeoGebra build of the SIR model of infectious disease spread. The result can be seen on the Numberphile YouTube channel. There are many things that I might do differently now, but it served a purpose of explaining some features of the sort of modelling which has become ubiquitous now. I recommend trying to build your own model if you want to get the most out of the video, but it is instructive to then go round the modelling cycle again and upgrade the model to capture some of the real data that we now have.
Here is a (less polished) file to which I've been adding live data as we get it. It also adjusts the model to include deaths (it is an SIRD model now) and plots the data alongside the model predictions, in normal scales and with logarithmic scales (on the right). Here is a link to the Google Drive ggb file and to the file on the GeoGebra website (please note that it takes a while to process online).
It also includes an option to add a 'lockdown' period which, in terms of the model, just reduces the transmission rate by a factor for a while (if you are interested, to keep the function differentiable I used a hyperbolic tan function for that - happy days!). I make no claim to realistic accuracy, but it was a useful and sobering exercise in real modelling.
The government keeps changing how it is reporting and collecting its data (classic modelling issues!) You can view the latest data for the UK on the government website, but you will need some spreadsheet skills to put the data in a format that you need.
It is a lesson in the painful realities of mathematical modelling. The difficulties of handling real messy data in formats that you don't like. The pain when models don't work for reasons that you don't understand. The satisfaction when they do work. The realisations of what they then predict.
Stay safe everyone!
By Ben Sparks