# Numerical Epidemics

#### Thorsten

##### Active member
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:

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

Spatial propagation of infection hotspots on the grid:

(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
Donator
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
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
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.

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
Donator
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
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
Donator
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 !
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
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
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

#### Urwumpe

##### Not funny anymore
Donator
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
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
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:

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.

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
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):

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
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.

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
Donator
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
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
Donator
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
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...

#### Urwumpe

##### Not funny anymore
Donator
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.

Replies
7
Views
1K
Replies
5
Views
1K
Replies
5
Views
761
Replies
24
Views
2K
Replies
3
Views
514