Tuesday, March 3, 2020

LabKitty Pandemic Simulator

LabKitty Mad Scientist logo
Recent events have rekindled my long-standing interest in epidemiology, as yet another emergent virus currently does a slow burn across the globe. COVID-19 arrives against a backdrop of influenza currently doing a slow burn across the globe, not to mention reduced herd immunity, declining antibiotic efficacy, and an incoherent public health response. Experts call this "instability in the disease dynamical manifold" but what they really mean is "asking for it."

We may never know how coronavirus came to be, although packing eleventy billion humans into an ecosystem seems to my way of thinking relevant. In any event, it didn't take long for politicians to exploit the situation. Republicans declared the virus was clearly designed in a Chinese weapons laboratory, because China has coronavirus and weapons laboratories. Yes, the logic is as airtight as the rationale. Are there votes to be had by gloating over dead Chinese? Apparently so in the red states of our waning republic.

Which got me thinking about designing a virus. Suppose you wanted to create a pandemic. How would you go about it? What would be the ideal virus? What parameters would you select? Where would you release the thing? How long would it take? What could anyone do to stop it?

There are CDC scientists studying such questions on supercomputers as we speak. One hopes. For the rest of us -- and perhaps for the CDC too, what with their recent budget cuts (thank you Donald Trump) -- there is Javascript.

I give you: jPandemic.



In the box below you will find a map of the world. Your mission is to design and release a virus that will engulf the globe. To keep things simple, I have reduced disease dynamics to one parameter: transmission -- how easy it is for one person to transmit the disease to another.

Once you have chosen a parameter from the slider, click anywhere in the map. This releases Patient Zero at that location. The sim will then display spread of your disease in red. The starting density of susceptible individuals (shown in greyscale) is based on population density (see algorithm details below for image credit). As such, if you release your Patient Zero in the arctic you will observe different results than, say, releasing him/her in Bombay.

Finally, you have the option to include airports. These exist by default (because they exist by default); removing the airports would be the equivalent of halting air travel.

Footnote: I occasionally find Chrome won't run this. If you experience wonkyness, try reloading the page.

You may change the transmission parameter, open/close airports, and/or release more infecteds while the sim is running, simulating virus mutation and/or an incoherent public health response. Epidemiology professionals, of course, use much more sophisticated modeling. I leave extensions as an exercise. Google Anderson and May or Hesterbeek or Linda Allen to get you started.




---

(hard) --- transmission --- (easy)





Algorithm Details

The sim is based on a simplified discrete-time SI epidemiology model applied across a regular grid: I[x][y][k+1] = β ⋅ S[x][y][k] ⋅ I[x][y][k]. Here, S[x][y][k] and I[x][y][k] are the number of susceptible and infected, respectively, at grid location (x,y) at time step k and β is the force of infection (set by the slider value: 0 < β < 5). Spatial propagation is modeled by including a portion of infecteds in the eight surrounding grid boxes in the update. Infected densities less than 0.001 are set to zero so that the finite color palette of the map more accurately reflects disease distribution.

Airports are representative of traffic to a given region and include only a fraction of the extant global air travel network. For the purpose of simulation, airports connect grid locations as if they were neighbors.

Starting values for susceptibles are based on a map of world population density circa 2007 created by Miguel Contreras and released into the public domain. The background image is a desaturated and resampled version of the original map.

The sim automaticaly halts after 2000 days have passed.

No comments:

Post a Comment