, 47 tweets, 10 min read
My Authors
Read all threads
Ok, so I said I'd do an R0 thread and there's plenty of classical epidemiologists that have done threads on the concept by now, but I've not seen anyone talk about the dynamical system perspective.
So first, preliminary: an R0, or R-naught, is a term describing the reproductive capacity of an organism. In epidemiology it refers to the number of secondary cases that result from a single case in an entirely susceptible population.
There's a practically identical concept in ecology about the reproductive capacity of an organism in an environment, so I should note early on that it's a common theme in math epi, you'll see parallels in math ecology.
Now, epidemiologists on the ground tend to chase cases and take documented reports.

Folks with my training tend to take that information, build simplified models, and run simulations.

The more advanced of these incorporate things like delay from exposure and geographic info.
So to give a little taste of how the mathy side looks, I'm going to introduce you to one of the most humble and familiar models a mathematical epidemiologist will encounter: the SIR model.
It's named as such because it's a system of three differential equations, one for each "compartment" of people: Susceptible, Infectious (or Infected), and Recovered classes.

Try not to let the diffeq part intimidate you too much. We've got a ways to go.
Here's the system. (Isn't it cute? 😍)

I'll break it down line by line in the subsequent tweets. Apologies for going slow since I'm doing the pen and paper treatment.
First, as you can guess, S refers to the susceptible population.

The dS/dt means change in the size of the susceptible class with respect to time - the first derivative.

Lambda is a (fixed) birth rate, and mu is a (fixed) death rate. We're not getting too fancy here yet...
We'll return to those and look at them more closely when I talk about the disease-free equilibrium (DFE).

The action here is in the middle term though - beta S I. As you can guess, I refers to the number of infected individuals. Beta is a "force of infection."
If you've ever looked at chemical kinetics, you might recognize it as a "mass action" term, where reagents A and B bind with some reaction coefficient, and you can increase the reaction by increasing the concentration of reagent A or B.

It's the same thing here.
So the idea is that, when a susceptible person and an infectious person meet, there's some probability that the susceptible person catches the disease and leaves the susceptible class - hence the minus sign.

Where do they go, though?
Let's look at the next line! Here is the change in time of the infectious class. And we have a positive beta*S*I term here!

They just moved to this compartment.
What else have we got on this line? Well, the mu is the same population-wide death rate as before.

But that alpha? What's happening there when someone leaves the infectious class that way?
Look down at the last line and we have the change over time of the size of the recovered class. And look, we have a positive alpha*I! So that must mean recovery, and alpha is a recovery rate.
And the only way people leave the recovered class is by dying at our natural death rate mu.

So to recap, and maybe see another picture before going on...
Everyone loves flow charts, right?

Here's another way to picture this model. We've got all the classes in boxes, and ways to enter and leave them in arrows.
Before we analyze anything I want to point out some features we have (or rather, don't have) here.

The death rate, mu? It's the same for everyone. So in this model we don't have any disease-induced mortality.
We also see instant transmission. More advanced models can introduce delays by throwing an Exposed class in there (making it an SEIR model) or by building what are called delay differential equations (DDEs).

The latter are terrible beasts not for the faint of heart.
Anyway, we have a humble system of equations.

"Great!" you say. "But what are you supposed to do with them? I don't want to do a bunch of calculus."

And I'll say, "That's wonderful because I only care about equilibria and I'm only going to need some algebra!"
This is not entirely an oversimplification. Most of these types of (nonlinear) models don't give you nice things you can integrate by hand, so we let computers do that.

But the equilibria? Stand back, we're going to do dynamics!
So I've said equilibria a few times without really explaining the meaning yet. The other terms used are steady state and fixed point, and it describes a system at rest.

Which, in other words, means nothing is changing.

Which means all those derivatives are zero!
So what's it mean if all those are zero? Well, it means for each class, S, I, and R, the number of people entering and leaving is the same, so the size of each of those populations is constant.
First, let's look at what we call the Disease Free Equilibrium (DFE). If you built a reasonable model, this should always be something you can calculate. After all, how are people going to move to the infected and recovered classes if you don't have any disease to start with?
So let's look at this line, where we've now said the number of susceptibles is staying constant (and that dS/dt is zero).

That beta*S*I term? With no infected folk in the population, it's zero! So all we really have to deal with is 0=Lambda - mu*S
Just a little algebra tells us that our steady-state value of the susceptible population, with no disease, is Lambda/mu. So we have, for our DFE, S=Lambda/mu, I=0, R=0.

"Great, but what about the disease stuff?" you say?
We're still not really to the R0 business, but we have to see both equilibria for the dynamical interpretation to make sense, so next we need to talk about the endemic equilibrium.

I've got the full system of equations below.
The endemic equilibrium, or EE, if it exists, has to satisfy these equations for I>0. (Negatives don't make much sense here!)

Now I'm gonna spare you the step by step for solving these and just write them out, and maybe make myself a drink in the process...
After a minor phone problem we're live again.

And with a cocktail.

(Recipe: Willett bourbon, Ancho Reyes chile liquor, angostura bitters, and Luxardo cherries. Proportion as a Manhattan.)
Anyway since I promised I wouldn't get too far in the weeds with the calculation I've got all the work below. I've numbered the equations, and the work references the equation number.
So notice how I put a little more work into factoring out that term where I have a (Lambda*beta)/(mu*(mu*alpha)) for the expressions for the steady states for I and R?

That's because, as we'll see, that's actually our R0!
I've rewritten the entire EE here (as E*) with all three parts.

So you know how I said the model only makes sense for positive values?

You can see by how I wrote this that we only have positive values for these if the thing I've called my R0 is greater than 1.
Notice how it's proportional to the birth rate and the force of infection (which hopefully seems sensible if you think about it for a little bit) and is inversely proportional to the death rate and the recovery rate (which hopefully also seems very sensible).
So a nifty way to look at this is as something we dynamicists call a "bifurcation parameter."

What that means is that our dynamical system changed as a function of that parameter (or collection of parameters).
We often graph it like this: we put R0 on the horizontal axis, and I on the vertical axis.

A solid line indicates a stable equilibrium; a dashed line indicates an unstable equilibrium.
What does stable and unstable mean? Well, we have a couple of concepts about stability.

We have what we call local stability and global stability.

Essentially, an equilibrium is locally stable if stuff immediately around it gets pulled into it.
Contrast this with global stability, which is the idea that (almost) everything get pulls into it no matter where it starts.

Think of a shower or tub drain as analogous to globally stable - everything slopes down into it.
Now contrast this with a wavy laminate floor where spilled water ends up in several distinct pools as an analogy to local stability. Where your spilled drink hit the floor determines where it will settle in.
For our little SIR model that could, we're in the straightforward case where everything is either globally stable or unstable.

Our DFE is globally stable if the R0 is less than one. You can interpret this as each case producing fewer subsequent cases than itself...
... so of course the disease dies out. It can't maintain itself. And our population eventually goes back to all susceptibles over (a really long) time.
But if the R0 is greater than one, suddenly we see the birth of a new equilibrium - a "forward bifurcation" if I'm being really technical here - and suddenly we have two equilibria.
And in this model it makes our DFE unstable, and the EE is the stable one.

As a technical matter of fact, the change in the local stability of the DFE is how we define the R0 in this context.
This is a technical point because in more advanced models we might have a still-locally-stable DFE but also an EE popping up further away. I might go over one of these a little a later night.
Now, actually showing in this SIR model the stability profile takes a little work, and I'll have to save it for another night - it will involve a little linear algebra - but the main takeaway is this:
For a dynamical systems epidemiologist, an R0 takes on a meaning slightly different than just case counting.

It's a number that tells us about the birth and death of equilibrium points in a dynamical model - about watching dance between hills and valleys. And that's kinda cool.
An aside on this: the Ancho Reyes substitution for the normal sweet vermouth is probably my favorite quick and easy substitution on the classic Manhattan without going slightly more exotic like the Brooklyn.

That little bit of heat and richness it adds is really the best.
I just realized this bit totally has the same vibe as @tpwky and their "quarantini" thing but I wasn't trying to step on any toes. At least this one already has an accepted name - the Manchancho. 😂
*Addendum: By "nothing is changing," I mean "the number of people going into a class is the same as the number going out," so the total number in the classes is unchanging. Not "no one is moving through the classes."
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with Ty

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!