I finally managed to get Neil Ferguson’s COVID-19 simulation running on my iMAC (4.2 GHz Quad-Core i7 with 16MB of memory). So it is untrue that you need some parallel supercomputer to run these simulations. The trick though is to first to switch off the default “parallelism” option in the make file before compiling the software. I suspect that Ferguson’s original c-code has recently been repackaged in C++ , along with a new directory structure all cleaned up for the release on GITHUB. The famous but now shorter 5000 line routine though is still there.
Having looked into the software a bit, I would describe his model as a Monte Carlo simulation of how an infectious disease evolves within the population of any country. A country (such as the UK) is divided into administrative units (regions) with population distributions parameterised by town size, age profiles, household sizes, on a detailed population grid. It is certainly not a simple SIR model – like mine.
The disease (Covid) is seeded in some location (London ?) with an initial 100 infected persons. The model then simulates the transmission rates within and across different locations (eg. schools, workplaces, home, transport, pubs etc.), types of person (age), and between towns (transport). As more people get infected so the number needing hospital treatment, ICU beds and eventually deaths is calculated with time. I think in the original paper the results were based on initial estimates of R and IFR data coming from China.
Different intervention scenarios aimed at curtailing the epidemic can then also be simulated, for example by “deducing” their effect on reducing the demand on NHS ICU beds and on the overall infection and death rates.
The guts of the simulation seems to be all in one file CovidSim.cpp which was originally written by Neil Fergusson in C, but during the cleanup process transferred to C++. There have recently been some scathing code reviews in the media, but I am not going to follow suit and criticise his code just for the hell of it. Yes it should have been structured better, but I am also pretty sure it is correct and has been evolving over a long period of time simulating ever more complex scenarios. When scientists write their own code they just want results and probably never consider the necessity for it all to be made publicly available. Now Ferguson finds himself in a global maelstrom so basically he had to publish his code, but beforehand it had to be at least partly sanitised.
Some reviewers have claimed that it has bugs because the results are “non deterministic” or”stochastic”. However in his defence, I would say that is exactly what Monte Carlo simulations always do. You can never get exactly the same result twice. Furthermore it is pretty obviously to me that the code is still under active development right now, since it is being added to in real time, for example to simulate UK’s new “test, track and trace” policy.
It also looks like another team in his group at IC have been working on the Github release because in order to run the Covid scenarios you now also need to have both Python and R installed. ( see here ). Python is used to generate the sample data and R is used to plot the results. Python alone would have been more than sufficient. As a result it is not going to be easy for the man in the street to get this software up and running. Luckily I had Python and R already installed.
Having struggled through the software build, I finally managed to run their sample COVID simulations provided for the UK which has two scenarios a) No intervention and b) Full Lockdown. It is run with an effective R = 3, which seems rather high to me ( R was 2.4 in Ferguson’s original paper). It runs on my Mac in about 50 mins. So here are the plots generated by their R-scripts (not really to my taste).
Finally these are the predicted deaths per week under lockdown measures (the no-intervention case reaches ~130K for last week in April).
So how has this worked out in the UK? These figures can now be compared to the actual data which is probably best represented by the independent ONS study of excess weekly deaths.
If you look at the bottom red curve which shows excess deaths directly related to COVID-19 then you can see that the lockdown predictions more or less agree with the outcomes. Does that mean that Neil Ferguson really did call the right shot?
Probably he did, yet still today we have a fundamental lack of knowledge of the real-time numbers of infected and recovered persons in the UK. This current obsession with R is actually misleading government policy because R will naturally change during any epidemic. R will always reach 1 in coincidence with the peak in cases and then fall rapidly towards zero.
At some point the costs of continuous stop-go lockdowns based on fear alone will become unbearable. We will have to learn to live with this virus.