Sunday, March 15, 2020

Flattening the Curve

LabKitty Mad Scientist logo
Now that amateur epidemiology is all the rage, what with the White House's official COVID-19 response consisting of whatever Jerry Kushner can find on Facebook (not kidding), it falls to the Interwebs to help us make sense of the world. It seems like only yesterday all was snips and snails and puppy dog tails, and today we're chained to the front of Furiosa's minivan. Except instead of a heavy metal guitar player shooting fire, the soundtrack is just an endless loop of Yakety Sax. If you don't understand God sent this as punishment for electing Donald Trump, you're not paying attention.

On a related note, I hate it when I'm right.

Which brings us to "flattening the curve." The pandemic lingo de jure, which to the uninitiated means not much. Who curve? Where flat? What it do, and when it be?

Well LabKitty is here to help. Since we can't go to the pub anymore, or the liquor store, or the pub, there's more time for illustrative Javascript. Let's dive into a little epidemiology modeling and decipher why medicos don't want us going to the pub anymore. Or the liquor store. Or anywhere, really. As it happens, the idea is almost a century old, emerging from the seminal work of Scottish biochemist Anderson Kermack and Scottish physician William McKendrick, published in 1927.

Read on.



The "curve" in "flattening the curve" refers to the Kermack-McKendrick SIR epidemiology curve. Specifically the "I" part, which tracks the number of infecteds we can expect over time as a given epidemic burns through a susceptible population.

Some background.

We classify every person in the population of interest as either in category S, category I, or category R. S and I are pretty straightforward -- these are the number of (or density of, depending on which model you use) susceptible and infected individuals, respectively. "R" is a shadier grey. An optimist would say R is the number of (or density of) "recovered" individuals. However, it is generally called "removed" to include the more unfortunate outcomes that nonetheless result in equivalent dynamics.

Some straightforward math defines the rules that determine how people transition between classes (go here for details). However, muy useful is the model only requires two parameters: 1) the contact rate, or how often an opportunity for disease transmission occurs, and 2) the recovery rate, which is easier to understand as the inverse of how long the infection lasts. These are typically denoted using the Greek letters beta (β) and gamma (γ).

These parameters can be arranged into a single number called the basic reproduction ratio (R0) that characterizes disease spread. Put simply, R0 is the average number of people a single infected person infects. If R0 < 1, the epidemic will die out. If R0 > 1, the epidemic will spread. Small R0 good. Big R0 bad. If you remember nothing else, remember that.

Chase the math around and you will discover that R0 = β/γ. Hence, to slow the spread of the disease, we want to make β small and γ big.

There's typically not much we can do about γ. The infectious period is more or less determined by the disease (it appears to be 5−14 days for COVID-19).

Which leaves β. This is how often a transmission opportunity occurs, which, yes, to a first approximation is determined by the disease, but the contact rate can be increased or decreased by doing or, preferably, not doing dumb things. Air travel, attending White House press conferences, and licking doorknobs fall into the former category; working from home, date Skyping, and not licking doorknobs fall into the latter.

Tweaking β and γ are not a panacea; they do not halt or not-halt the disease. All we can do is steer the dynamics. We can press the gas or press the brake, but we're still going to have to ride the crazy train into the station. All we can hope for is a gooder landing or a worser landing, to mix a metaphor.

None of which makes much sense until you see it in action, so I whipped up a little Javascript for you to play with. (Although civilization may be ending, we all must still work on our Javascript skills. I like to think these will be exchangeable for food and loose women in whatever new economy emerges when this is over.)

Susceptibles (K), Infected (R), Removed (B)
---



---


---


The app generates three plots -- susceptibles (black), infected (red), and removed (blue) -- as a function of time. These are sampled once per time unit and so are drawn as discrete points rather than as a continuous curve. The vertical scale is arbitrary -- think of the values of S, I, and R as being a number between 0 and 1, where 0 is, well, none, and 1 is the largest possible number, whether that number is all members of your household, school, city, country, or planet. The horizontal scale is arbitrary time units (the literal scale depends on the units of the parameter values).

At time zero, the values of S, I, and R are set to 0.99, 0.01, and 0, respectively, simulating a small cohort of infecteds introduced into a uniform susceptible population. You pick values for β and γ using the sliders. For most values, the epidemic will stabilize in one screen's worth of time, so the sim halts at that point. Change the parameters and click run to superimpose the new dynamics over the current results. Click erase to erase the screen at any time.

The effect you are looking for is obtained by choosing smaller values of β (less frequent transmission opportunities) and larger values of γ (briefer infectious period -- remember: "rate" = 1/period). Both result in fewer infected cases (red peak smaller) and also the number of infecteds peaks later.

This is called "flattening the curve." Fewer infections spread over a longer time gives our health care resources a fighting chance to respond effectively. Conversely, parameter selection (read: behaviors) that result in a large rapid influx of infecteds tend to overwhelm the system. That's when we start exploring the more unpleasant interpretations of the "R" category.

Choose wisely.
SKULL!

No comments:

Post a Comment