A Community Coronavirus Model for Bozeman

This video explores a simple epidemic model for a community confronting coronavirus.

I built this to reflect my hometown, Bozeman MT and surrounding Gallatin County, with a population of 100,000 and no reported cases – yet. It shows the importance of an early, robust, multi-pronged approach to reducing infections. Because it’s simple, it can easily be adapted for other locations.

You can run the model using Vensim PLE or the Model Reader (or any higher version). Our getting started and running models videos provide a quick introduction to the software.

The model, in .mdl and .vpmx formats for any Vensim version:

community corona 7.zip

Update 3/12: community corona 8-mdl+vpmx.zip

There’s another copy at https://vensim.com/coronavirus/ along with links to the software.

Coronavirus – Really Simple Math

Why border control has limits, and mild cases don’t matter.

At the top, the US coronavirus response seems to be operating with (at least) two misperceptions. First, that border control works. Second, that a lower fatality rate means fewer deaths. Here’s how it really works.

Consider an extremely simplified SEIRD model. This is a generalization of the simple SIR framework to include asymptomatic, non-infective Exposed people and the Deceased:

The parameters are such that the disease takes about a week to incubate, and about a week to resolve. The transmission rate is such that cases double about once a week, if left uncontrolled.

Those fortuitous time constants make it really simple to model the spread in discrete time. First, abstract away the susceptible (who are abundant early in the epidemic) and the resolved cases (which are few and don’t participate further):

In this dirt-simple model,

  • This week’s infected will all resolve
  • This week’s exposed will advance to become next week’s infected
  • Next week’s exposed are the ones the current infected are infecting now.

If the disease is doubling weekly, then for every 1 infected person there must be 2 exposed people in the pipeline. And each of those infected people must expose 4 others. (Note that this is seemingly an R0 of 4, which is higher than what’s usually quoted, but the difference is partly due to discrete vs. continuous compounding. The R0 of 2.2 that’s currently common seems too low to fit the data though – more on that another time.)

What does this imply for control strategy? It means that, on the day you close the border, the infected arrivals you’ve captured and isolated understate the true problem. For every infected person, there are two exposed people on the loose, initiating domestic community spread. Because it’s doubling weekly, community infections very quickly replace the imports, even if a travel ban is 100% effective.

Mild Cases

Now consider the claim that the fatality rate is much lower than reported, because there are many unobserved mild cases:

In other words, the reported fatality rate is Deceased/(Recovered+Deceased), but the “real” fatality rate is Deceased/(Recovered+Deceased+Mild Recovered). That’s great, but where did all those mild cases come from? If they are sufficiently numerous to dilute the fatality rate by, say, a factor of 10, then there must also be 9 people with mild infections going undetected for every known infected case. That doesn’t help the prognosis for deaths a bit, because (one tenth the fatality rate) x (ten times the cases) yields the same outcome. Actually, this makes the border control and community containment problem much harder, because there are now 10x as many contacts to trace and isolate. Fortunately this appears to be pure speculation.

Stock markets and coronavirus – an endogenous perspective

Markets collapse when they’re in a vulnerable state. Coronavirus might be the straw that broke the camel’s back – this time – but there’s no clear pandemic to stock price causality.

The predominant explanation for this week’s steep decline in the stock market is coronavirus. I take this as evidence that the pandemic of open-loop, event-based thinking is as strong as ever.

First, let’s look at some data. Here’s interest in coronavirus:

It was already pretty high at the end of January. Why didn’t the market collapse then? (In fact, it rose a little over February). Is there a magic threshold of disease, beyond which markets collapse?

How about other pandemics? Interest in pandemics was apparently higher in 2009, with the H1N1 outbreak:

Did the market collapse then? No. In fact, that was the start of the long climb out of the 2007 financial crisis. The same was true for SARS, in spring 2003, in the aftermath of the dotcom bust.

There are also lots of examples of market crashes, like 1987, that aren’t associated with pandemic fears at all. Corrections of this magnitude are actually fairly common (especially if you consider the percentage drop, not the inflated absolute drop):

Wilshire Associates, Wilshire 5000 Full Cap Price Index [WILL5000PRFC], retrieved from FRED, Federal Reserve Bank of St. Louis; https://fred.stlouisfed.org/series/WILL5000PRFC, February 28, 2020.
So clearly a pandemic is neither necessary nor sufficient for a market correction to occur.

I submit that the current attribution of the decline to coronavirus is primarily superstitious, and that the market is doing what it always does.

It’s hard to do it justice briefly, but the stock market is basically an overlay of a complicated allocation mechanism on top of the real economy. In the real economy (green positive loop) capital and technology accumulation increase output (thinking strictly of on-market effects). Growth in that loop proceeds steadily in the long run, but with bumps from business cycles. The stock market is sending signals to the real economy about how to invest, but that’s complicated, hence the dashed line.

In the stock market, prices reflect expectations about the future flow of dividends from the economy (blue negative loop). If that were the whole story, coronavirus (orange) would have to have induced fears of a drop in the NPV of future profits of about 10%. Hopefully that’s way outside any plausible scenario. So why the big drop? It’s due to the other half of the story. Expectations are formed partly on fundamentals, and partly on the expectation that the market will go up, because it’s been going up (red positive loop).

There are actually a number of mechanisms behind this: naive extrapolation, sophisticated exploitation of the greater fool, redirection of media attention to prognosticators of growth when they’re right, and so on. The specifics aren’t important; what matters is that they create a destabilizing reinforcing feedback loop that inflates bubbles. Then, when some shock sufficient to overcome the expectations of appreciation arrives, the red loop runs the other way, as a vicious cycle. Diminished expected returns spark selling, lowering prices, and further diminishing expectations of appreciation. If things get bad enough, liquidity problems and feedback to the real economy accentuate the problem, as in 1929.

Importantly, this structure makes the response of the market to bad news nonlinear and state-dependent. When SARS and H1N1 arrived, the market was already bottomed out. At such a point, the red loop is weak, because there’s not much speculative activity or enthusiasm. The fact that this pandemic is having a large impact, even while it’s still hypothetical, suggests that market expectations were already in a fragile state. If SARS-Cov-2 hadn’t come along to pop the bubble, some other sharp object would have done it soon: a bank bust, a crop failure, or maybe just a bad hot dog for an influential trader.

Coronavirus may indeed be the proximate cause of this week’s decline, in the same sense as the straw that broke the camel’s back. However, the magnitude of the decline is indicative of the fragility of the market state when the shock came along, and not necessarily of the magnitude of the shock itself. The root cause of the decline is that the structure of markets is prone to abrupt losses.

For a nice exploration of these dynamics, from the complexity/nonlinear dynamics thread of systems science, see Didier Sornette’s Why Stock Markets Crash: Critical Events in Complex Financial Systems.

Coronavirus Roundup

I’ve been looking at early model-based projections for the coronavirus outbreak (SARS-CoV-2, COVID-19). The following post collects some things I’ve found informative. I’m eager to hear of new links in the comments.

This article has a nice summary, and some

Disease modelers gaze into their computers to see the future of Covid-19, and it isn’t good

The original SIR epidemic model, by Kermack and McKendrick. Very interesting to see how they thought about it in the pre-computer era, and how durable their analysis has been:

A data dashboard at Johns Hopkins:

A Lancet article that may give some hope for lower mortality:

The CDC’s flu forecasting activity:

Some literature, mostly “gray” preprints from MedRxiv, all open access:

A podcast with some background on transmission from Richard Larson, MIT (intestine alert – not for the squeamish!):

This blog post by Josh at Cassandra Capital collects quite a bit more interesting literature, and fits a simple SIR model to the data. I can’t vouch for the analysis because I haven’t looked into it in detail, but the links are definitely useful. One thing I note is that his fatality rate (12%) is much higher than in other sources I’ve seen (.5-3%) so hopefully things are less dire than shown here.

I had high hopes that social media might provide early links to breaking literature, but unfortunately the signal is swamped by rumors and conspiracy theories. The problem is made more difficult by naming – coronavirus, COVID19, SARS-CoV-2, etc. If you don’t include “mathematical model” or similar terms in your search, it’s really hopeless.

If your interested in exploring this yourself, the samples in the standard Ventity distribution include a family of infection models. I plan to update some of these and report back.

6 more reasons to apply SD to medical research

@SDWisdom Ken Cooper lists 6 good reasons to apply System Dynamics to medical research. I think there are more if you broaden the definition of ‘medical’ :

7. Dose titration can be dynamically complex and subject to misperceptions of feedback; models make it easy.

8. Chronic autoimmune and mental health problems are embedded in a nest of feedback between the disease and the person’s environment.

9. ERs, hospitals and other delivery systems are loaded with delays, feedback and nonlinearity.

10. Smoking, diet, exercise, and other big health drivers are social phenomena.

11. Diet and exercise are entangled with other systems, like urban design and energy efficiency.

12. The health insurance system, especially in the US where it has evolved into a mess, can’t be redesigned without a systemic perspective.

4 Faces of Medical Modeling

I enjoyed the biomedical modeling plenary at #ISDC2019 more than most. I was struck by the continuum of behavior involved in the system:

  • True biomedical modeling is a bit funny, because it’s not typical System Dynamics, in the sense that it’s nonlinear dynamic simulation, but it’s not behavioral, so it’s missing one of the cornerstones of SD. Nevertheless, I think the way we think about complex systems is a useful complement to other approaches coming more from biology and mathematics (nonlinear dynamics).
  • Behavior enters one level “up”, in problems like Jim Rogers & Ed Gallaher’s work on dose titration in anemia. This is a classic case of smart people having trouble managing a system with fairly simple dynamics – essentially a single pipeline delay in the case of anemia. There may be many similar cases, where large performance improvements are available from simple models (but complicated people management).
  • Next, there are problems that combine behavioral dynamics and misperceptions of feedback with an underlying system that is also quite complex. Gizem Aktas’ work on stress and hormonal regulation is an example, as are diabetes and mental health models.
  • At the far end of the scale, there are health system models, like ReThink Health, which abstract away from the biomedical details of any particular disease. In its place, there’s an extremely complex network of human resources, incentives and decisions.

I think the opportunities are large in all of these areas. Once challenge for the field is that each requires a different interface to other researchers, health practitioners and managers. That’s a lot for relatively few modelers to manage. How can we team up to be more effective?

Biological Dynamics of Stress: the Outer Loops

A while back I reviewed an interesting model of hormone interactions triggered by stress. The bottom line:

I think there might be a lot of interesting policy implications lurking in this model, waiting for an intrepid explorer with more subject matter expertise than I have. I think the crucial point here is that the structure identifies a mechanism by which patient outcomes can be strongly path dependent, where positive feedback preserves a bad state long after harmful stimuli are removed. Among other things, this might explain why it’s so hard to treat such patients. That in turn could be a basis for something I’ve observed in the health system – that a lot of doctors find autoimmune diseases mysterious and frustrating, and respond with a variation on the fundamental attribution error – attributing bad outcomes to patient motivation when delayed, nonlinear feedback is responsible.

Since then, I’ve been reflecting on the fact that the internal positive feedbacks that give the hormonal system a tipping point, allowing people to get stuck in a bad state, are complemented and amplified by a set of external loops that do the same thing. I’ve reorganized my version of the model to show how this works:

Stress-Hormone Interactions (See also Fig. 1 in the original paper.)

The trigger for the system is External Stress (highlighted in yellow). A high average rate of stress perception lengthens the relieving time for stress. This creates a reinforcing loop, R1. This is analogous to the persistent pollution loop in World3, where a high level of pollution poisons the mechanisms that alleviate pollution.

I’ve constructed R1 with dashed arrows, because the effects are transient – when stress perception stops, eventually the stress effect on the relieving time returns to normal. (If I were reworking the model, I think I would simplify this effect, so that the stock of Perceived Stress affected the relieving time directly, rather than including a separate smooth, but this would not change the transience of the effect.)

A second effect of stress, mediated by Pro-inflammatory Cytokines, produces another reinforcing loop, R2. That loop does create Internal Stress, which makes it potentially self-sustaining. (Presumably that would be something like stress -> cytokines -> inflammation -> pain -> stress.) However, in simulations I’ve explored, a self-sustaining effect does not occur – evidently the Pro-inflammatory Cytokines sector does not contain a state that is permanently affected, absent an external stress trigger.

Still more effects of stress are mediated by the Cortisol and Serotonin sectors, and Cortisol-Pro-inflammatory Cytokines interactions. These create still more reinforcing loops, R3, R4, R5 and R6. Cortisol-serotonin affects appear to have multiple signs, making the net effect (RB67) ambiguous in polarity (at least without further digging into the details). Like R1 (the stress self-effect), R3, R4 and R6 operate by extending the time over which stress is relieved, which tends to increase the stock of stress. Even with long relief times, stress still drains away eventually, so these do not create permanent effects on stress.

However, within the Cortisol sector, there are persistent states that are affected by stress and inflammation. These are related to glucocorticoid receptor function, and they can be durably altered, making the effects of stress long term.

These dynamics alone make the system hard to understand and manage. However, I think the real situation is still more complex. Consider the following red links, which produce stress endogenously:

One possibility, discussed in the original paper but out of scope for the model, is that cognitive processing of stress has its own effects. For example, if stress produces stress, e.g., through worrying about stress, it could become self-sustaining. There are plenty of other possible mechanisms. The cortisol system affects cardiovascular health and thyroid function, which could lead to additional symptoms provoking stress. Similarly, mood affects family relationships and job productivity, which may contribute to stress.

These effects can be direct, for example if elevated cortisol causes stressful cardiovascular symptoms. But they could also be indirect, via other subsystems in one’s life. If you incur large health expenses or miss a lot of work, you’re likely to suffer financial stress. Presumably diet and exercise are also tightly coupled to this system.

All of these loops create abundant opportunity for tipping points that can lock you into good health or bad. I think they’re a key mechanism in poverty traps. Certainly they provide a clear mechanism that explains why mental health is not all in your head. Lack of appreciation for the complexity of this system may also explain why traditional medicine is not very successful in treating its symptoms.

If you’re on the bad side of a tipping point, all is not lost however. Positive loops that preserve a stressful state, acting as vicious cycles, can also operate in reverse as virtuous cycles, if a small improvement can be initiated. Even if it’s hard to influence physiology, there are other leverage points here that might be useful: changing your own approach to stress, engaging your relationships in the solution, and looking for ways to lower external stresses that keep the internal causes activated may all help.

I think I’m just scratching the surface here, so I’m interested in your thoughts.