Numerical Epidemics

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
While we've currently being bombarded with arguments based on R0 and fear of exponential growth in the news media, I eventually got curious why we do not see exponential growth in any country. Could it really be that they're all equally effective in containment procedures such as to reduce R0 to exactly 1 and get a roughly constant daily number of new infections (and an ever-decreasing growth percentage). Or is there more at play?

As a result of a discussion I had, I did what I usually do when a problem bothers me - I start doing some theory to research it.

So here's a piece of GPL-licensed software where you can simulate the spread of an epidemic for a population on a square grid - and do things like limit social contacts to the local environment rather than assume they're all across the grid.


See here for the download and a (growing) tutorial.

It's not overly sophisticated (yet), but you can already do a nice range of instructive scenarios. Here's a few pictures:

Exponential growth followed by logistic turnover - what you're used to seeing:

epidemic_exponential.png


Dramatic slowdown by restricting mobility (a person is only allowed 80 social contacts rather than 40.000)

epidemic_mobility_comparison.png


Spatial propagation of infection hotspots on the grid:

flamefront_400.png


(The answer to the initial question is - exponential growth on large scale can't happen because populations can't mix fast enough and the local social contacts saturate too quickly to sustain it - thus even with no or insufficient containment measures, the model predicts an ever-decreasing daily grows percentage and a roughly constant daily number of new infections after an initial rapid growth phase - but you don't need to believe me, you can simply inspect the code and run it yourself :)).
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,752
Reaction score
2,498
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
That is why the R0 is now getting more important, the measurement how many people a contagious person can inject.

Also, that the number of new infections stays constant or drops is not automatically a good achievement, since this could also happen by other causes - for example lack of testing capacity.

A cellular automata could maybe also model this well, by including testing rules.
 

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
That is why the R0 is now getting more important, the measurement how many people a contagious person can inject.

Actually in the model R0 turns out to be a bad measure - what happens is that you try to fit an exponential to a function which is not an exponential (something we should have learned to avoid when making any fit) - you get something like a local slope of course, but it ceases to have the original interpretation and predictive power.

Also, that the number of new infections stays constant or drops is not automatically a good achievement, since this could also happen by other causes - for example lack of testing capacity.

You'd notice by comparing with the two-week shifted death rates whether that happens (assuming deaths are generally harder to miss). There's such consistency checks you can run on the raw data.
 
Last edited:

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
My major insight today - we all know that opening up completely after a lockdown gets us necessarily back to exponential growth and a second wave of infections, right?

Actually not.

lockdown.png


it's a possible outcome, but there's many scenarios in which the propagation of the infection is fundamentally changed after the lockdown and never picks up the prior speed no matter that the restrictions are no longer in place.

(Currently I'm implementing temporary measures and restrictions to the software - that's not published yet, but I'll make it available soon :) )
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,752
Reaction score
2,498
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Well - technically it is still exponential growth, but the size of the population got reduced, that still can be infected. Thus, the net reproduction rate should be much lower.

Measles for example have a base reproduction rate of 15-18, but vaccinating 94% of the population reduces the net reproduction rate to less than one.

Would of course get interesting, how the plot would look like, if the immunity against SARS-CoV-2 gets lost after 6 months, as feared.
 

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
Well - technically it is still exponential growth,

No, it's almost always a power law. The growth isn't scale-invariant, there's an intrinsic scale set by the number of potential social contacts of a person. People don't have a million friends, acquaintances, colleagues and shop-owners they visit, the true number is much lower.

Which is why it doesn't make sense to fit a base reproduction number to a power law - wrong functional form.

but the size of the population got reduced, that still can be infected.

As you can easily convince yourself from the plot, there's hardly any growth during the lockdown in the plot (it's the flat part of the curve starting from day 300), so the size of the population that can still be infected is - to a few % accurac -the same before and after the lockdown.

So that's not it - the reason has to do with the spatial (de-)correlation of immune people with respect to the active spreading front - you can't see that without a grid.

Would of course get interesting, how the plot would look like, if the immunity against SARS-CoV-2 gets lost after 6 months, as feared.

I'm not sure who fears such a thing... at least we seem to have moved on from 'never immune' though... But even while you're never technically getting completely immune to Herpes, it gets transformed from something really painful to a nuisance you hardly notice.

Anyway, as you can also convince yourself, in a steep growth scenario most people have become immune only recently.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,752
Reaction score
2,498
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
No, it's almost always a power law. The growth isn't scale-invariant, there's an intrinsic scale set by the number of potential social contacts of a person. People don't have a million friends, acquaintances, colleagues and shop-owners they visit, the true number is much lower.


Still you describe an exponential function. Even if you assume that there is just a low number of contacts that an contagious person does not share with the person who infected it, it is still an exponential function and no polynomial. The base is (relatively) constant (of course it should drop when more people are getting infected), while the exponent is a function of time.
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
You guys are discovering the difference between academical discussion and reality ;)
Scientific projections are always a simplification and a worst case scenario.

And cumulative curves are misleading. Just imagine a cumulative curve for more than 100 years of flu, with reinfections. Probably to total of cases would be higher than the total population.
It would be better to only consider active cases.
 

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
Still you describe an exponential function. Even if you assume that there is just a low number of contacts that an contagious person does not share with the person who infected it, it is still an exponential function and no polynomial. The base is (relatively) constant (of course it should drop when more people are getting infected), while the exponent is a function of time.

I know an exponential when I see one and I know a power law when I see one. An exponential has for instance a constant daily increase percentage, a power law has not.

It's a very simple an testable criterion - and it says 'no exponential'.:)

You can also try to get a good fit with an exponential - you'll fail miserably.


You guys are discovering the difference between academical discussion and reality

In what way?

The starting point for me was that there's no exponential seen in nature, so I was very curious what needs to be added to a model to see that non-exponential behavior.

It would be better to only consider active cases.

You can do that using the software at the simple expense of plotting a different column, but at least for me this didn't bring any novel insight (and makes it generally harder to see what the underlying dynamics is).
 

RisingFury

OBSP developer
Addon Developer
Joined
Aug 15, 2008
Messages
6,427
Reaction score
492
Points
173
Location
Among bits and Bytes...
If the virus infected 25% of the population and the the cured could not get reinfected, the average distance between a sick person and a susceptible one is increased significantly, but currently only a few percent of the population got infected with the new virus and we're not even sure you can't get reinfected. If we behave as if the epidemic is over, exponential growth will return.

Well, except in Sweeden. They just let the epidemic infect everyone :p
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,752
Reaction score
2,498
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
I know an exponential when I see one and I know a power law when I see one. An exponential has for instance a constant daily increase percentage, a power law has not.


So, you would say that the atmospheric density is a linear function of altitude, because the approximation works fine sometimes? ;)
 

Linguofreak

Well-known member
Joined
May 10, 2008
Messages
5,042
Reaction score
1,283
Points
188
Location
Dallas, TX
I know an exponential when I see one and I know a power law when I see one. An exponential has for instance a constant daily increase percentage, a power law has not.

It's a very simple an testable criterion - and it says 'no exponential'.:)

You can also try to get a good fit with an exponential - you'll fail miserably.

On a semi log plot of actual COVID data, one generally sees significant stretches on a semi-log plot that fit well to a straight line, with curved transitions between straight sections with different exponents. Now, trying to fit *any* function to the entire curve will fail, but the curve tends to look like a piecewise combination of exponentials.
 

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
Now, trying to fit *any* function to the entire curve will fail, but the curve tends to look like a piecewise combination of exponentials.

A semi-log plot is an extremely tolerant thing for visual inspection... The US Coronavirus outbreak wiki page has that optical trick plotted.

Here's the derivative of the same data (the daily number of new infections) from the same wiki page:

66162d82525b5ca0c7b24761234fab8145710545.png


That's a constant with statistical fluctuations. When you integrate it, you get an approximately linear increase.

Whereas the derivative of an exponential function would be... an exponential.


Anyway - I at least know how exponential growth and its derivative looks like, if people insist in calling something that's manifestly not exponential an exponential, then it's a bad use of my time to convince them otherwise.:)


If the virus infected 25% of the population and the the cured could not get reinfected, the average distance between a sick person and a susceptible one is increased significantly, but currently only a few percent of the population got infected with the new virus and we're not even sure you can't get reinfected. If we behave as if the epidemic is over, exponential growth will return.

Again, I have yet to see exponential growth in the real data for more than a few days in a row - the growth is self-quenching, the data screams that at you. Even in Sweden the speed of the spread is decreasing.

And - people have strong antibody response after 3 months (that's how long cases have been tracked) - and according to the people tracking these cases, there's no reason to think the response will decay quickly (i.e. within the next months). So I've yet to see any evidence of re-infection or faulty immunity - people getting well again is because they get immune - both are other words for 'antibody kills virus''.

Coming back to the model (which is what this thread is about) - that says that once you've slowed the first wave with a hard intervention, any further spread will be permanently slowed - and can be stopped dead with a comparatively low-level intervention.

containment02.png


It also says a relatively low number of prior immunity level (or from a first wave) is sufficient to make a big effect.

So I'm going to venture the guess that if we haven't seen much exponential growth till now, it's unlikely to 'return' in any way - especially now that people are more aware of the disease and a significant fraction is more careful.

For anyone who wants to give it a try - here's version 0.2 of the code for download.
 
Last edited:

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
It's been a while and I was busy with other stuff, but still...

On a semi log plot of actual COVID data, one generally sees significant stretches on a semi-log plot that fit well to a straight line, with curved transitions between straight sections with different exponents. Now, trying to fit *any* function to the entire curve will fail, but the curve tends to look like a piecewise combination of exponentials.

Here's a quick demo with gnuplot where you see a beautiful piecewise 'fit' of two exponentials to a power law (a quadratic function):

powerlaw.png


Looking familiar?

Here we know for a fact that the purple function has nothing to do with exponential growth - as I said, semi-log plots are visually very forgiving.
 

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
Another interesting question that emerged of late - how can it be that Germany saw a long period of low-level infection when opening up after the lockdown while Israel is seeing a strong second wave with numbers on track to reach pre-lockdown levels - while in both countries the rate of new infections has been very low during the end of the lockdown?

The latter point is interesting - it is perhaps not surprising that in the US, where the infection rate was never brought really low, it increases quickly once restrictions are eased. But what makes the difference between Israel and Germany?

After running some scenarios, the model system actually qualitatively reproduces all three cases under the right conditions. If so, Israel may have intervened too early and stopped the spread before sufficient pockets of immune people could be created (which dramatically slow the infections after an efficient lockdown in the model).

Here's a test case of the same containment measure applied to the same (same random seed) infection scenario with only the starting date changed.


intervention_date.png


The day 50 intervention leads to the worst final outcome because the disease picks up full speed in a second wave later. The same intervention on day 220 stops the disease for good (and actually, even seeding with new infections the situation never reaches a critical growth again).

So it's not a problem that can be computed from the bare numbers 'now' - what's important is how the 'now' was reached.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,752
Reaction score
2,498
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
After running some scenarios, the model system actually qualitatively reproduces all three cases under the right conditions. If so, Israel may have intervened too early and stopped the spread before sufficient pockets of immune people could be created (which dramatically slow the infections after an efficient lockdown in the model).


That is also what German scientists calculated back in 2012 for the fictive Modi-SARS virus, about finding the right strategy against something more dangerous than SARS. The same conclusion that you found can in fact be found nearly word for word in the report for the Modi-SARS simulation.



Still, it might be that the number of immune people in Germany is too low to explain this, it might also be the ongoing voluntary caution and economic slow-down.
 

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
The same conclusion that you found can in fact be found nearly word for word in the report for the Modi-SARS simulation.

Well, if the model captures the relevant parts of reality and the math is solid, everyone should be able to arrive at the same findings


Still, it might be that the number of immune people in Germany is too low to explain this, it might also be the ongoing voluntary caution and economic slow-down.

It's not so much the total number of immune people that matters for the flat dynamics in the model - it's also where (*) they are - in proximity of the currently sick people (largely because they've been the ones who infected them in the first place).

So there seems enough immunity around in Germany to locally hinder the expansion - which means that likely the situation is still somewhat unstable and holding large-scale events which mix a lot of people would be a really bad idea at this point.

And yes - it could also be that voluntary caution is another factor at play - I don't have a good enough picture of the situation in Israel to gauge whether there's a strong difference or not.


(*) 'where' in an abstract social space where people you meet regularly are close-by.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,752
Reaction score
2,498
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
And yes - it could also be that voluntary caution is another factor at play - I don't have a good enough picture of the situation in Israel to gauge whether there's a strong difference or not.


Well, Israel is VERY complicated in that sense, since it is really made of multiple, nearly exclusive sub-populations with vastly different social behaviour. Even if a large number of people there act reasonable and try to keep the curve flat, there are enough not-so-reasonable people around, who serve as an excellent reservior for the virus.
 

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
Even if a large number of people there act reasonable and try to keep the curve flat, there are enough not-so-reasonable people around, who serve as an excellent reservior for the virus.

I'm not entirely sure I'd see that as a difference to Germany...

hygienedemo-103~_v-modPremium.jpg
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,752
Reaction score
2,498
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
I'm not entirely sure I'd see that as a difference to Germany...


I doubt those people could live in a community with other people... while orthodox jews form big villages in Israel.
 
Top