Computer Simulations to Show the Impact of Social Distancing in Spreading the Coronavirus
We designed a model simulation to show how diseases such as the corona virus can spread through communities. While the author does have a Ph.D., and studied modeling & simulation, he is not a ‘real doctor’, a public health expert or an epidemiologist. The simulations are simplistic and needless to say does not model all real-world factors.
We wanted to setup a basic model purely out of our own curiosity and this was all hacked together in one evening of coding. Specifically we wanted to understand:
- Are we over-reacting to the corona virus since it sometimes sure feels that way. What would have happened if we just continued life as always?
- What would be the impact of social distancing and is this really going to help?
- What is the impact if we really were to cut out almost all social interactions outside of (possibly a large) family and room-mates?
A user can play with it to begin to understand the impact of decisions on society. Feel free to change the parameters on the right and hit the “Run” button to re-run the simulation with changes. If you feel more ambitious, the entire source-code is included right there on the Simulate Anything website and you can modify, save a new version or even fork to start a new branch, add your own parameters etc. The results of running the simulation on a range of parameters and outcomes are included in the table at the bottom.
Once again here is the master simulation with all the source code and parameters. But read through this write-up below first since you will get a better grasp of what's going on.
Population Size. For simplicity and speed we start with a population size of 100K, roughly San Francisco scaled down by a factor of 10. San Francisco has about 40 cases of Coronavirus, and so we scaled it down to 4 as the default disease population. We realize this number could be much larger because of untested individuals and we will address that in a bit.
Virulence or Resistance. We define a concept of resistance, informally and colloquially, as the average number of people you interact with who carry the disease and are contagious for it to spread to you. For example a resistance of 0.95 would mean that you need to interact with 20 contagious individuals on average before you contract the disease.
Incubation, Disease. Incubation period is the number of days you are asymptomatic but contagious. Incubation period under current scientific studies are around 5 days for the COVID-19 [1]. Disease period is the number of days you have the disease. By default we use 4 and 7 for these parameters which seems conservative.
Quarantine. We have a quarantine if sick so they have no chance of spreading the disease after they experience symptoms. In reality COVID-19 has about a 30% chance of infected individuals who are asymptomatic and therefore do not quarantine themselves [2]. While we set this factor to 1 by default (always quarantine if they display symptoms), we are being very conservative.
Interaction Model. We have a “Global” or “Neighborhood” interaction model. A Global model means you meet random people such as a store associate, people in a movie theatre, in restaurants, conferences, schools etc. A neighborhood model is basically when people are at home and only interact with their immediate family. Specifically each person repeatedly interacts with a limited number n of people. The number of people interactions is the number of people one interacts with on a daily basis.
Here are some interesting scenarios that we were curious about. You can recreate these simulation results from the master simulation by adjusting the parameters on the right and hitting "Run" button.
Life As Always Scenario. Are we over-reacting? At times it certainly feels that way. So, first, we consider a conservative San Francisco day with no distancing. We use 100K population size, 4 individuals with the disease, 10 random interactions a day, 0.95 resistance, and even full quarantine when sick. The result? We basically have absolutely no chance of stopping the disease — it will hit the majority (80%) of the SF population very quickly. And if thats a model for the rest of the US, it will hit most of the US population spreading across cities independently and we pretty much have no chance whatsoever. To make matters worse, these outcomes are pretty robust to a lot of change in parameters which are already very conservative. The output from the simulation run is shown in the above Figure on the left side.
Social Distancing. Second, we consider the setting where we are restricted to our homes for the most part. No meeting random people in conferences, schools, restaurants, movies etc. Now the results change dramatically. Try just updating Interaction Model from “Global” to “Neighborhood” while keeping the rest of the parameters the same. Firstly, you’ll notice that we dramatically cut down on the percent infected. Second, you’ll notice that we dramatically slow down the spread of the disease. Once again, this is in fact robust to even increasing the number of people you interact with as long as it is the same group of people. The output from the simulation run is shown in the above Figure on the right side.
Stay At Home. Third, under the same “Neighborhood” model, just cut down the number of people interactions from 10 to 4, the size of a typical family. Now we will in fact quickly beat the disease and wipe it out completely. Even in cases when we do not wipe it out (from 4–10 interaction size or lower resistance) we have it totally under control. Once again, this is also robust for lower resistance levels and higher starting disease population levels that is more reflective of reality.
Mixed or Restricted Global Interaction. Now, you may wonder what about a ‘mixed’ interaction model. The problem here is that even a little bit of global interaction (set to 4) and resistance of 0.9 (slightly lower than 0.95) is enough to let the disease out of control and infect 2/3rd of the population before dying out. If we reduce global interaction from 4 to 3, the disease infects about 1/3rd of the population. And if we did not quarantine sick, then in fact it spreads to nearly everyone reiterating that life as normal, even under very conservative restricted global interaction has little to no chance of beating the disease.
All these scenarios and some more are summarized below.
Take Aways. So what do I make out of this?
Life as usual, seems largely impossible to work. You would have had to count on natural resistance, immunity, the weather or some external factors to slow down the rate. Or you have to accept that the majority of the population will get infected and that is okay. Outside of that, it certainly does not look like we are over-reacting. The response is in fact an absolute brutal necessity.
Given that San Francisco has nearly 1M people with only 40 cases, we have reason to be optimistic. It looks like we may still have enforced policies well within time. This largely requires people to limit random interactions. You can forget about school, conferences and music concerts. We are talking a handful of meaningful interactions a day with a random person is all that may be needed to let this get out of control. On the flip side, we still have timing on our side. If we reduce the number of random interactions to at most 2 (bare minimum), then it feels very real that we have this thing under total control, possibly even wiped out if we are extremely lucky and everyone plays a role. This would certainly at least easily delay to ease hospitals and get us time to fight it medically. But it really is that close when it comes to external random contact outside your immediate family.
Thanks to Joshua Levy for being the original inspiration to study simulations, for checking my code for bugs, providing valuable parameters and insights!
Head of Data Sciences
5 年This is awesome! Is there anyway to include the degree/magnitude of isolation (i.e. what if 15% vs 75% of the entire network opting for neighborhood model). I believe in order to have an effective impact, a significant portion of the network needs to participate at the same time (though you have captured this through as one-off case of global_interaction=4 and resistance=0.9)
VP, North America Sales at Opus 2 | Investor | Board Member | Advisor
5 年The is excellent Srinath Sridhar
Partnerships and Operations at Intuit
5 年It really is amazing how impactful limiting social interactions is on the # infected over time. Seeing it in the simulation as I change the numbers, really hammers home the importance of staying at home!!!!
Managing Director - Financial Advisor at Morgan Stanley
5 年Good work Sri! Stay safe in the meantime
Director @ LinkedIn | Content Publishing, Product Development, Cross-functional Lead
5 年Incredible share. Thank you!