Thursday, April 9

A back of the envelope model for flattening the curve

Before I retired, I spent a number of years working with computerised policy models in a number of social policy departments in the Commonwealth. While I have no direct knowledge, I expect the Commonwealth Health Department has a sophisticated model for the pandemic. I cannot replicate that level of sophistication. Nor can I replicate the complexity of the model from the Doherty Institute

But I can build a simple, toy model - perhaps in a couple of hundred lines of code - that allows me to get a feel of what the dynamics of the pandemic might look like. In this simple model, I have made a number of assumptions for the sake of easy implementation.
  • let's ignore population dynamics - ie. no births, deaths, migration
  • let's ignore external sources of infection - ie. I assume there will be no further imported infections from international travel
  • let's ignore demographic dynamics - different disease outcomes for different age groups and ethnicities
  • let's ignore seasonal dynamics - although we suspect higher transmission rates in winter
  • let's ignore the impact of co-morbidities - notwithstanding these seem very important
  • let's assume full ongoing immunity for those infected who have recovered - although the reality might only be less than full immunity and/or immunity with a half-life of (say) 3, 6 or 12 months
  • let's ignore transmission differences that might be associated with asymptomatic carriers versus symptomatic carriers

The model I have coded is a simple SIR model - which divides the population into three cohorts, those who are susceptible to infection (S), those who are infected (I), and those who are resistant to reinfection (R). I have extended the infection category to three linear phases (infected (but not yet infectious), infectious, and [for some] hospitalised). I have extended the resistant cohort to being either recovered and immune, or dead. So actually, there are six categories or states in my model: 'susceptible', 'infected', 'infectious', 'hospitalised', 'recovered', 'dead'. The model works in proportions of the whole population (so the six categories always sum to one).

The model takes a simulation approach, on a day-to-day basis (rather than using calculus to solve a series of ordinary differential equations). This limits subtlety and nuance. The model requires a number of the inputs to be whole integers and cannot deal with fractional periods of infectiousness for example.

The other key assumptions I have made are starting points and process times.
  • At the start of the model, I have assumed there are roughly 1000 people infected/exposed and a further 1000 who are infectious. This is an arbitrary small number, but it may not be too far from the current situation.
  • I have assumed the time from infection to being infectious is 3 days on average
  • I have assumed people are infectious for 8 days on average.
  • I have assumed that infectious people will touch 2.5 other people on average (but only those in the susceptible population will become infected).
  • I have assumed that 6 per cent of infectious people will be hospitalised.
  • I have assumed the average period of hospitalisation is 9 days.
  • And I have assumed that 0.9 per cent of infected people will die (ie. nine in every 1000 infected people will die). 

These values are all educated guesses based on my reading of newspapers and journal articles.

I have also had a stab at the policy impact of testing, tracing and social distancing on the basic reproduction number for the pandemic in Australia ($R_0$). While my suspicion is that fatigue will set in after a month or so, and the effectiveness of these measures will wane, I have not looked at this. To model policy impacts, I have arbitrarily assumed that these policy interventions would reduce the basic reproduction number to 1.5 or 1.2. These alternative cases show that the curve flattens, and the peak demand for health services is delayed.

Please note: this is NOT a proper epidemiological model. Think of it more as a rough pencil sketch. Nonetheless, my experience has been that such toy models are a good way to check in on and understand the output from more accurate, sophisticated and complex models. Feel free to play with any of the above assumptions.

Let's start with my base case - no policy response to the virus - a basic reproduction number of $R_0=2.5$ - we just let it rip.



 The key data points from this model were:
  • Dead: 206,934 (0.81%) 
  • Max in hospital at any point in time: 444,770 (1.7%) 
  • Max hospitalised occurs on day: 86 
  • Pop still susceptible at conclusion: 2,510,502 (9.8%) 
  • Max new infections/day at peak: 853,270 
  • Max new infections/day occurs on day: 71 
  • Max new hospitalisations/day at peak: 51,196 
  • Max new hospitalisations/day occurs on day: 82 
  • Max deaths/day at peak: 7,679 
  • Max new deaths/day occurs on day: 91

The above outcome is hard to comprehend.  The health system is completely overwhelmed by an enourmous peak. In the next model, we assume that policy measures have reduced the basic reproduction number to $R_0=1.5$.



The key data points from this model were:
  • Dead: 134,755 (0.53%) 
  • Max in hospital at any point in time: 117,820 (0.5%) 
  • Max hospitalised occurs on day: 162 
  • Pop still susceptible at conclusion: 10,530,323 (41.3%) 
  • Max new infections/day at peak: 219,436 
  • Max new infections/day occurs on day: 147 
  • Max new hospitalisations/day at peak: 13,166 
  • Max new hospitalisations/day occurs on day: 158 
  • Max deaths/day at peak: 1,974 
  • Max new deaths/day occurs on day: 167

An improvement, but still pretty dire. We still have an overwhelmed health system. Let's look at $R_0=1.2$:




The key outcomes for this model are
  • Dead: 71,969 (0.28%) 
  • Max in hospital at any point in time: 27,352 (0.1%) 
  • Max hospitalised occurs on day: 291 
  • Pop still susceptible at conclusion: 17,489,996 (68.6%) 
  • Max new infections/day at peak: 50,706 
  • Max new infections/day occurs on day: 276 
  • Max new hospitalisations/day at peak: 3,042 
  • Max new hospitalisations/day occurs on day: 287 
  • Max deaths/day at peak: 456 
  • Max new deaths/day occurs on day: 296

We can put these three different models side by side to see the potential curve flattening and peak delay:





What these three models suggest to me is that we will need to continue to be vigilant on border control, testing-tracing-isolation, and social distancing, if we don't want to see Australian deaths climb into the hundreds of thousands. And if we don't want to see the health system swamped by the demand for services. But this comes at a very high economic cost. Furthermore, the willingness of people to practice the current level of social distancing is likely to wane over time.

My suspicion is that sustaining the economic cost and the disciplined practice of social distancing is going to prove challenging, the longer it takes for a vaccine to be developed and administered.

The python code for this model can be found on my GitHub gist site.

Update

 I have now solved this model as a series of ordinary differential equations. Which you can see at my GitHub gist site.

1 comment: