Sunday, 29 March 2020

Fun with numbers - flattening the curve

Numberphile did an interesting video on the models they use to predict the spread of viruses:

I reverse engineered their spreadsheet with a few basic assumptions (you become infectious as soon as you are infected and remain infectious for seven days) to mirror their results (scaled up to UK population). The only variable we can seriously influence is how many people an infectious person infects every day ('daily rate').

The resulting curve is hyper-sensitive to any changes in the daily rate, so I can sort of understand why governments around the world have reacted (panicked?) the way they did.

UPDATE: AK Haart tells us that Sweden decided to just isolate the elderly and unwell and leave everybody else to go on as normal. So that's the country to watch.

At a daily rate of 0.15, it would take two years before the number of serious cases still in progress reaches 10,000. (After a week, one infectious person has infected 7 days x 0.15 new cases/day  = 1.05 new cases. So day 7 starts with 2.05 cases but the first one recovers (or dies) and drops out again). If the daily rate is less than 0.15, it just fizzles out again, obviously.

To get the curve to match the growth in the number of cases recorded in the UK so far, the daily rate would have to be about 0.3, which - according to the model - would lead to a peak in serious cases of 2 million after about ten weeks, and ten weeks after that, it would fizzle out again.

Here are three pairs of charts, showing totals (population not yet infected*; mild live cases, serious live cases; and immune for everybody who's had it) and the number of serious cases (assume one-tenth of those infected) for three different daily rates. The X-axis is days from outbreak:

Daily rate 0.16 - serious cases peak at 70,000 after thirteen months

Daily rate 0.18 - serious cases peak at 250,000 after seven months

Daily rate 0.2 - serious cases peak at 500,000 after five months

As mathematically enjoyable as all this is, I'm not sure those models are much use, beyond telling us that the lower the daily rate, the better.

In real life, the number of new cases which are recorded each day seems to flatten off after one or two months and then decline again. Worldinfo compiles all the available statistics country-by-country, including a chart of new cases recorded each day. Whether this flattening is because of all the lock downs, or whether it would have happened anyway, we will never know.

* It seems counter-intuitive that even with a high daily rate of 0.2, half the population (the blue line in the Totals charts) never gets it. That's because once half the population has had it and is immune, those who are infectious can only infect half as many each day as they could have done at the start. So the effective daily rate would fall to about 0.1, at which stage the whole thing fizzles out.


Shiney said...


So maybe a herd immunity strategy, rather than trashing the economy via a lockdown, would've been a better option?

I'm asking rather than asserting BTW.

Oh and this seems pertinent...

Mark Wadsworth said...

Sh, that's a good find. Backs up what I suspect.

I'm not sure on 'herd immunity strategy'. Doing nothing is not really a 'strategy'. Doing nothing might well have been the more sensible course of action, but we'll never know.

View from the Solent said...

Sweden is taking what looks like the 'herd immunity' approach. No shutdown of social activities, schools, etc, and only the elderly and already unwell are advised to quarantine.

One to watch.

PJH said...

More playing with numbers; MinutePhysics:

View from the Solent said...

Your last para explains the logistic curve* which plots the spread of any epidemic. Cumulative infections on the vertical axis, time on the horizontal. Slow start, rapid increase, tails off.

* e.g.

Mark Wadsworth said...

VFTS, aha, the herd immunity strategy means "isolate the elderly and the ill". I didn't realise that. I though it meant "do nothing". In which case my apologies to Shiney.

If I had been in charge, that is what I would have done. The elderly and ill have every incentive to comply; the young and healthy have every reason to ignore the shut downs. It would need extra resources and staffing to look after them safely for a few months (like setting them all up with a food delivery app, screening care workers etc), but that costs a lot less than shutting everything down.

PJH, good video. Coincidentally, I watched that one yesterday.

VFTS, I reverse engineered it from his explanation in the video. I didn't realise that was what it was called, so I explained it again anyway.

Sackerson said...


Lola said...

Define the 'ill and the elderly'?
That's going to be tricky. I am both 68 and have heart issues and asthma. And I am buggered if I am going to bossed around by some officious bureaucrat... :-)

View from the Solent said...

I'm an elderly (apparently officially defined as >70 in UK), and under the Swedish approach I'd limit my social interaction *voluntarily*. Not permanently shut myself away, but take those precautions which seemed sensible to me. Even though that would be a bummer, knowing that the pubs were open and staying away.
As long as it was my decision and not enforced by cohorts of age gauleiters.

Mark Wadsworth said...

S, ta. Another maths buff having a field day!

L, from what I've read, you really ought to be careful, even if that complies with government advice.

VFTS, exactly.

Lola said...

MW VFTS Yes, exactly and agreed. I always have. I don't take kindly to grandchildren turning up with coughs and colds. And my staff have always been told not to come in if they have a cold or whatever - "Don't you dare bring that in here. Stay home. Get fit". There's nothing noble about coming in to work if you're unwell.

In other words, like VFTS, I can take care of myself, I don't need Gauleiters either.

Bayard said...

"If I had been in charge, that is what I would have done."

To be fair to Johnson and Co, that is what they tried to do, but since they had spent decades buggering up the NHS, they realised that option wasn't open to them, as the NHS would have been overwhelmed.

I'm hoping, that, when this is all over, this fact will become abundantly clear to everyone.

Mark Wadsworth said...

B, I'm not usually one to defend the Tories, but they and Labour were just as bad.

I have a mate who does accounts for the NHS, he rang me this morning for a chat and said that the NHS had been down sizing itself even under New Labour. Spending less on health care and more on corporate jollies, racial sensitivity training, endless reorganisations, NHS Spine, no smoking signs etc.

The NHS gets over £100 billion a year. Why don't they have a team of forecasters, contingency planners, people who are aware that there are pandemics every decade or so? People who can divert 0.1% of the NHS budget into PPE and ICU stuff to put into storage 'just in case'?

The South Koreans clearly do. So this time, when it was clear the pandemic wouldn't just blow over (like SARS, MERS, swine flu and all the others), the South Koreans got all their PPE and ICU equipment out of storage and deployed it. The Germans seem to have enough testing kits (which is why they are so many recorded cases; they can actually identify them) and appear to be handling it very well.

And no, the Tories did not do the sensible Swedish thing and just tell the elderly and unwell to stay at home, sort out food and medicine deliveries or whatever else they need. They did nothing at all; and then they went on the other tack and did way too much.

Physiocrat said...

The potential problem with the Swedish approach is that age is only a proxy for vulnerabilities, which probably include diabetes/pre-diabetes, metabolic syndrome, hypertension and history of smoking and living with air pollution, or occupational factors. The vulnerability may also be due not to the conditions but to the long-term medication used to control those, and other illnesses, due to the effect of the drugs on the immune system. However, these factors are not confined to old people but become increasingly widespread among all adults over the age of 40.

When the infection runs through the schools, the risk is that the children will take it home with them and give it to their parents and grandparents. It is ethnic minority communities in Sweden who will be hit hardest - there has already been a disproportionate number of Somalis in the statistics. Native Swedish grandparents, on the other hand tend to lead lives of self-isolation by preference and are habitually fussy over hygiene, which makes them relatively safe. The surge of cases also threatens to overwhelm the health services. It is political dynamite.

An interesting experiment is in progress, you could say.

Physiocrat said...

@View from the Solent
If you were a native elderly person in Sweden you would be limiting your social interaction anyway as a lifestyle choice. Having to avoid using public transport is a bit of a bummer, though.

Bayard said...

Mark, New Labour were Tories and still are. Real Labour reappeared with Corbyn and will no doubt disappear with his successor. Neither can be trusted to run the NHS properly, though. The Tories always cripple it with underfunding, which does nothing to sort out its manifold inefficiencies and Labour cripple it by allowing the inefficiencies to grow and flourish.