Sunday, August 2, 2020

iCOVID: Individual Based Epidemic Modeling

LabKitty Mad Scientist logo
Previously on LabKitty, we attempted COVID simulation in the large, using what a professional epidemiologist would call mass action modeling. There it was assumed the variability and vagaries of individual actors can be glossed over, condensing all behavior into a mythical average behavior that is captured by a few numbers. In the SIR mass action model, the few numbers are the number of susceptible, infected, and recovered in the population plus the transmission and recovery parameters.

However, an alternate approach exists in which we literally follow each individual individually, a bottom-up attack that constructs the evolution of an epidemic as the sum of its parts. This goes by the name individual-based modeling. We generate a history for each individual in the population, then assemble the population response by mashing together everybody's story.

Which brings us, once again, to COVID.



Individual-based modeling has become popular of late, largely because it requires cheap fast hardware which means the approach wasn't practical until recently and doing new things is how nerds get tenure. Additionally, they're arguably more realistic than a stochastic mass action model and implementation is not terribly difficult, the basic ingredients being a list of events and exponentially distributed random numbers. Even an amateur epidemiologist like LabKitty can code an IBM. On the other paw, if you're waiting for me to solve the Fokker-Planck equation or some other stochastic mass action horror, you are going to be waiting for a long time indeed.

We may disagree on the details, but relevant life events during a pandemic can be broadly categorized into two categories: 1) events that increase your chances of getting sick, and 2) events that decrease your chances of getting sick. I sat here and thinked up a representative collection of each, wrapped some Javascript around my lists, and viola! I give you iCOVID. An individual-based model for COVID-19 (see below).

The instructions are simple. You begin frightened and alone, as do we all. There are three possible endpoints: 1) you can get COVID and die, 2) you can get COVID and recover, or 3) you can survive until a vaccine arrives. To get a definite endpoint, we'll assume a vaccine will arrive in one year. To play, you simply push the "run a simulation" button. The program will construct a hypothetical life history, listing the major events which led to your avatar's triumph or demise until whatever ultimate end arrives.

Footnote: The savvy among you will recognize this as a simplified implementation of Gillespie's method. The truly savvy will recognize this as my zombie apocalypse simulator with different text.

As it stands the sim is incomplete; we should really accumulate results and synthesize the population response. While I have done such a thing in the past (for my voting app), that server no longer exists and my motivation for buying server time and learning PHP or whatever is currently rather low, especially when I could be doing other lockdown activities like drinking and binge watching Chefs Who Taunt. Tut mir leid.

And anyway, what we really need are realtime updates, so that individual actor decisions affect global parameters like the force of infection. Something along the lines of a wholly unfun MMORPG. An exercise for a future post, perhaps.

No comments:

Post a Comment