Simulating Covid-19 Scenarios

I must warn that this is a super long post. Also I wonder if I should put this on medium in order to get more footage.

Most models of disease spread use what is known as a “SIR” framework. This Numberphile video gives a good primer into this framework.

The problem with the framework is that it’s too simplistic. It depends primarily on one parameter “R0”, which is the average number of people that each infected patient infects. When R0 is high, each patient infects a number of other people, and the disease spreads fast. With a low R0, the disease spreads slow. It was the SIR model that was used to produce all those “flatten the curve” pictures that we were bombarded with a week or two back.

There is a second parameter as well – the recovery or removal rate. Some diseases are so lethal that they have a high removal rate (eg. Ebola), and this puts a natural limit on how much the disease can spread, since infected people die before they can infect too many people.

In any case, such modelling is great for academic studies, and post-facto analyses where R0 can be estimated. As we are currently in the middle of an epidemic, this kind of simplistic modelling can’t take us far. Nobody has a clue yet on what the R0 for covid-19 is. Nobody knows what proportion of total cases are asymptomatic. Nobody knows the mortality rate.

And things are changing well-at-a-faster-rate. Governments are imposing distancing of various forms. First offices were shut down. Then shops were shut down. Now everything is shut down, and many of us have been asked to step out “only to get necessities”. And in such dynamic and fast-changing environments, a simplistic model such as the SIR can only take us so far, and uncertainty in estimating R0 means it can be pretty much useless as well.

In this context, I thought I’ll simulate a few real-life situations, and try to model the spread of the disease in these situations. This can give us an insight into what kind of services are more dangerous than others, and how we could potentially “get back to life” after going through an initial period of lockdown.

The basic assumption I’ve made is that the longer you spend with an infected person, the greater the chance of getting infected yourself. This is not an unreasonable assumption because the spread happens through activities such as sneezing, touching, inadvertently dropping droplets of your saliva on to the other person, and so on, each of which is more likely the longer the time you spend with someone.

Some basic modelling revealed that this can be modelled as a sort of negative exponential curve that looks like this.

p = 1 - e^{-\lambda T}

T is the number of hours you spend with the other person. \lambda is a parameter of transmission – the higher it is, the more likely the disease with transmit (holding the amount of time spent together constant).

The function looks like this: 

We have no clue what \lambda is, but I’ll make an educated guess based on some limited data I’ve seen. I’ll take a conservative estimate and say that if an uninfected person spends 24 hours with an infected person, the former has a 50% chance of getting the disease from the latter.

This gives the value of \lambda to be 0.02888 per hour. We will now use this to model various scenarios.

  1. Delivery

This is the simplest model I built. There is one shop, and N customers.  Customers come one at a time and spend a fixed amount of time (1 or 2 or 5 minutes) at the shop, which has one shopkeeper. Initially, a proportion p of the population is infected, and we assume that the shopkeeper is uninfected.

And then we model the transmission – based on our \lambda = 0.02888, for a two minute interaction, the probability of transmission is 1 - e^{-\lambda T} = 1 - e^{-\frac{0.02888 * 2}{60}} ~= 0.1%.

In hindsight, I realised that this kind of a set up better describes “delivery” than a shop. With a 0.1% probability the delivery person gets infected from an infected customer during a delivery. With the same probability an infected delivery person infects a customer. The only way the disease can spread through this “shop” is for the shopkeeper / delivery person to be uninfected.

How does it play out? I simulated 10000 paths where one guy delivers to 1000 homes (maybe over the course of a week? that doesn’t matter as long as the overall infected rate in the population otherwise is constant), and spends exactly two minutes at each delivery, which is made to a single person. Let’s take a few cases, with different base cases of incidence of the disease – 0.1%, 0.2%, 0.5%, 1%, 2%, 5%, 10%, 20% and 50%.

The number of NEW people infected in each case is graphed here (we don’t care how many got the disease otherwise. We’re modelling how many got it from our “shop”). The  right side graph excludes the case of zero new infections, just to show you the scale of the problem.

Notice this – even when 50% of the population is infected, as long as the shopkeeper or delivery person is not initially infected, the chances of additional infections through 2-minute delivery are MINUSCULE. A strong case for policy-makers to enable delivery of all kinds, essential or inessential.

2. SHOP

Now, let’s complicate matters a little bit. Instead of a delivery person going to each home, let’s assume a shop. Multiple people can be in the shop at the same time, and there can be more than one shopkeeper.

Let’s use the assumptions of standard queueing theory, and assume that the inter-arrival time for customers is guided by an Exponential distribution, and the time they spend in the shop is also guided by an Exponential distribution.

At the time when customers are in the shop, any infected customer (or shopkeeper) inside can infect any other customer or shopkeeper. So if you spend 2 minutes in a shop where there is 1 infected person, our calculation above tells us that you have a 0.1% chance of being infected yourself. If there are 10 infected people in the shop and you spend 2 minutes there, this is akin to spending 20 minutes with one infected person, and you have a 1% chance of getting infected.

Let’s consider two or three scenarios here. First is the “normal” case where one customer arrives every 5 minutes, and each customer spends 10 minutes in the shop (note that the shop can “serve” multiple customers simultaneously, so the queue doesn’t blow up here). Again let’s take a total of 1000 customers (assume a 24/7 open shop), and one shopkeeper.

 

Notice that there is significant transmission of infection here, even though we started with 5% of the population being infected. On average, another 3% of the population gets infected! Open supermarkets with usual crowd can result in significant transmission.

Does keeping the shop open with some sort of social distancing (let’s see only one-fourth as many people arrive) work? So people arrive with an average gap of 20 minutes, and still spend 10 minutes in the shop. There are still 10 shopkeepers. What does it look like when we start with 5% of the people being infected?

The graph is pretty much identical so I’m not bothering to put that here!

3. Office

This scenario simulates for N people who are working together for a certain number of hours. We assume that exactly one person is infected at the beginning of the meeting. We also assume that once a person is infected, she can start infecting others in the very next minute (with our transmission probability).

How does the infection grow in this case? This is an easier simulation than the earlier one so we can run 10000 Monte Carlo paths. Let’s say we have a “meeting” with 40 people (could just be 40 people working in a small room) which lasts 4 hours. If we start with one infected person, this is how the number of infected grows over the 4 hours.

 

 

 

The spread is massive! When you have a large bunch of people in a small closed space over a significant period of time, the infection spreads rapidly among them. Even if you take a 10 person meeting over an hour, one infected person at the start can result in an average of 0.3 other people being infected by the end of the meeting.

10 persons meeting over 8 hours (a small office) with one initially infected means 3.5 others (on average) being infected by the end of the day.

Offices are dangerous places for the infection to spread. Even after the lockdown is lifted, some sort of work from home regulations need to be in place until the infection has been fully brought under control.

4. Conferences

This is another form of “meeting”, except that at each point in time, people don’t engage with the whole room, but only a handful of others. These groups form at random, changing every minute, and infection can spread only within a particular group.

Let’s take a 100 person conference with 1 initially infected person. Let’s assume it lasts 8 hours. Depending upon how many people come together at a time, the spread of the infection rapidly changes, as can be seen in the graph below.

If people talk two at a time, there’s a 63% probability that the infection doesn’t spread at all. If they talk 5 at a time, this probability is cut by half. And if people congregate 10 at a time, there’s only a 11% chance that by the end of the day the infection HASN’T propagated!

One takeaway from this is that even once offices start functioning, they need to impose social distancing measures (until the virus has been completely wiped out). All large-ish meetings by video conference. A certain proportion of workers working from home by rotation.

And I wonder what will happen to the conferences.

I’ve put my (unedited) code here. Feel free to use and play around.

Finally, you might wonder why I’ve made so many Monte Carlo Simulations. Well, as the great Matt Levine had himself said, that’s my secret sauce!

 

Hanging out on Hangouts

The covid-19 crisis has fundamentally changed the way we work, and I thikn some things we are not going to get back. For the foreseeable future, at least, even after official lockdowns have been lifted, people will be hesitant to meet each other.

This means that meetings that used to earlier happen in person are now going to happen on video calls. People will say that video calls can never replace the face-to-face meetings, and that they are suboptimal, especially for things like sales, account management, relationship management, etc.

The main reason why face-to-face interactions are generally superior to voice or video calls is that the latter is considered transactional. Let’s say I decide to meet you for some work-related thing. We meet in one of our offices, or a coffee  shop, or a bar, and indulge in pleasantaries. We talk about the traffic, about coffee, about food, do some random gossip, discuss common connects, and basically just hang out with each other for a while before we get down to work.

While these pleasantaries and “hanging out” can be considered to be a sort of transaction cost, it is important that we do it, since it helps in building relationships and getting more comfortable with each other. And once you’ve gotten comfortable with someone you are likely (at the margin) to do more business with them, and have a more fruitful relationship.

This kind of pleasantaries is not common on a phone call (or a video call). Usually phone calls have more well defined start and end boundaries than in-person meetings. It is rather common for people to just get started off on the topic of discussion rather than getting to know one another, cracking jokes, discussing the weather and all that.

If we need video and phone calls to become more effective in the coming months (at least as long as people aren’t stepping out), it is imperative that we learn to “hang out on hangouts”. We need to spend some time in the beginning of meetings with random discussions and gossip. We need to be less transactional. This transaction cost is small compared to the benefit of effectively replicating in-person meetings.

However, hanging out on hangouts doesn’t come easily to us – it’s not “natural”. The way to get around it is through practice.

On Sunday night, on a whim, I got onto a group video call with a bunch of college friends. Midway through the call I wondered what we were doing. Most of the discussion was pointless. But it gave us an opportunity to “hang out” with each other in a way we hadn’t for a long time (because we live in different places).

Overall, it was super fun, and since then I’ve been messaging different groups of friends saying we should do group video chats. Hopefully some of those will fructify. Along with the immediate fun to be had, they will also help me prepare better for “hanging out” at the beginning of my work meetings.

I think you should do them, too.

The Anti-Two Pizza Rule

So Amazon supposedly has a “two pizza rule” to limit the size of meetings – the convention is that two pizzas should be sufficient to feed all participants in any meeting. While pizza is not necessarily served at most meetings, the rule effectively implies that a meeting can’t have more than seven or eight people.

The point of the rule is not hard to see – a meeting that has too many people will inevitably have people who are not contributing, and it’s a waste of their time. Limiting meeting size also means cutting total time employees spend in meetings, meaning they can get more shit done.

While this is indeed a noble “rule” in a corporate setting, it just doesn’t work for parties. In fact, after having analysed lots of parties I’ve either hosted or attended over the years, and after an especially disastrous party not so long ago (I’ve waited a random amount of time since that party before writing this so as to not offend the hosts), I hereby propose the “anti two pizza rule” for parties.

While five to eight people is a good number for a meeting, having enough people contributing but no deadweight, the range doesn’t do well at all for more social gatherings. The problem is that with this number, it is not clear if the gathering should remain in one group, or split into multiple groups.

When you have a “one pizza party” (5-6 people or less), you have one tight group (no pun intended) and assuming that people will get along with each other, you’re likely to have a good time.

When you have a “three pizza party” (more than 10 people), it’s intuitive for the gathering to breakup into multiple groups, and if things go well, these groups will be fluid and everyone will have a good time. Such a gathering also allows people to test waters with multiple co-attendees and then settle on the mini-group that they’ll end up spending most time with.

A two-pizza party (6-10 people), on the other hand, falls between the two stools. One group means there will be people left out of the conversation without respite. In such a small gathering, it is also not easy to break out of the main group and start your own group (again, seating arrangement matters). And so while some attendees (the “core group”) might end up having fun, the party doesn’t really work for most participating parties.

So, the next time you’re hosting a party, do yourself and your guests a favour and ensure that you don’t end up with between 6 and 10 people at the party. Either less or more is fine!

You might want to read this other post I’ve written on coordinating guest lists for birthday parties.

Meeting types

There are essentially three kinds of meetings – those that are entirely “in person”, those that are entirely “on call” and hybrids. I argue that the quality of conversation in the third kind of meeting is significantly inferior to that of the first two types.

In person meetings are those where all participants are in one room. These are perhaps the best kind of meetings (except when you know it’s likely to turn antagonistic), for you can maintain eye contact with the others and as long as the number of meeters is small, there is social pressure on meeters to not be distracted, and thus the meeting is likely to conclude its agenda productively and quickly.

Conference calls allow you to multitask while you are on the meeting – the positive thing is that you can choose to switch off when you want to, but the downside of that is that you don’t know when one of the others is switching off, and this might take longer to conclude your agenda. However, the good thing about such meetings is that everyone is speaking into the phone, is well aware that it’s only voice that is getting transmitted and thus moderate their speaking accordingly.

The problem is with the hybrids – where some people are in one room and others are dialling in. Some of these meetings are not a problem – let’s say there are two parties that are party to the meeting, and all members of one party are in one location and all members of the other party in the other location, it is rather simple – you are much more likely to speak addressing the other party, and thus your voice and gestures are as if you’re on a conference call, and you speak more for the benefit of the counterparties at the other end of the line rather than your colleagues sitting with you in your room.

There are some meetings, however, where either you have way too many parties, or a particular party gets split between people physically present and people who are listening in. These meetings are the most disastrous and least likely to add value. I’ve been on both sides of such meetings – being in camera and dialling in, and have got immensely stressed out on both such occasions.

The problem with such meetings is that you’re not clear who you are addressing. Let’s say you are in camera. If you speak addressing the people sitting with you, you are likely to use a lot of body-part gestures to enhance your message, and speak in a voice that is appropriate for the room. Neither of this translates well over the phone – for people who have dialled in, neither will the voice be clear nor will they get the full import of the talking since they can’t see the hand gestures! And so they feel left out and are compelled to switch off.

On the other hand, if you are in camera and decide to speak addressing primarily the people who have dialled in, others in your room will get disturbed and switch off. You will tend to speak too loudly, for you desire to speak into the speakerphone, and given you are primarily address people who can’t see you, you don’t bother with niceties such as using your body parts for gesturing or maintaining eye contact with anyone. Thus, people in your room will get alienated and switch off!

It is the same case when you are dialling in. Firstly you don’t know when to intervene, for you miss possible visual cues that the others are using to communicate subliminally. When you do intervene you don’t know if you can be heard, and the other participants who would have by now been used to giving physical feedback – like eye contact or a nod or a smile or a wink, fail to give you the verbal feedback that you now desire! And while listening you get alienated as I’ve explained earlier.

A meeting where some people are in camera and some dialling in does no good for anybody. It is hence preferable to avoid such meetings. However, there are some occasions when for some desired participants it is not possible to be physically present. A good solution for such occasions would be to march the other attendees back to their offices and do the whole thing over call. It is definitely less stressful than a half-and-half hybrid meeting!

Arranged Scissors 8: Culture fit with parents

That you are in the arranged marriage process means that your parents now have full veto power over whom you marry. Given that you don’t generally want them to veto someone whom you have liked, the most common protocol as I understand is for parents to evaluate the counterparty first, and the “candidate” to get only the people who have passed the parental filter. Then the “candidates” proceed, and maybe meet, and maybe talk, and maybe flirt and maybe decide to get married.

Hypothesis: The chance of your success in the arranged marriage market is directly proportional to the the culture fit that you have wtih your parents.

Explanation: Given that parents have veto power in the process, and given the general protocol that most people follow (which I have described in the first para above; however, it can be shown that this result is independent of the protocol), there are two levels of “culture fit” that an interested counterparty has to pass. First, she has to pass the candidate’s parents’ culture fit test. Only after she has passed the test does she come in contact with the candidate (in most cases, not literally).

Then, she will have to pass the candidate’s culture fit test. By the symmetry argument, there are two more such tests (girl’s parents’ filter for boy and girl’s filter for boy). And then in the arranged marriage setting, people tend to evaluate their “beegaru” (don’t think english has a nice phrase for this – basically kids’ parents-in-law). So you have the boy’s parents evaluating the girl’s parents for culture fit, and vice versa.

So right at the beginning, the arranged marriage process has six layers of culture fit. And even if all these tests are passed, one gets only to the level of the CMP. (given that very few filter down to this level, i suppose a lot of people put NED at this stage and settle for the CMP).

Without loss of generality, let us now ignore the process of boy’s parents evaluating girl’s parents and vice versa (the problem is complex enough without this). So there are basically four evaluations, made by two pairs of evaluators (let us consider parents as one entity – they might have difference in opinion between each other occasionally but to the world they display a united front). Now for each side it comes down to the correlation of expectations between the side’s pair of evaluators.

The higher the “culture fit” you possess with your parents, the higher the chance that you will agree with them with regard to a particular counterparty’s culture fit. And this chance of agreement about culture fit of counterparty is directly proportional to the chance of getting married through the arranged marriage process (basically this culture fit thing can be assumed to be independent of all other processes that go into the arranged marriage decision; so take out all of those and the relationship is linear). Hence proved.

Now what if you are very different from your parents? It is very unlikely that you will approve of anyone that they will approve of, and vice versa. In such a situation it is going to be very hard for you to find someone through the arranged marriage process, and you are well advised to look outside (of course the problem of convincing parents doesn’t go away, but their veto power does).

So the moral of the story is that you should enter the arranged marriage market only if you possess a reasonable degree of culture fit with your parents.

(i have this other theory that in every family, there is a knee-jerk generation – one whose “culture” is markedly different compared to that of its previous generation. and after each knee-jerk, cultural differences between this generation and the following few generations will be low. maybe i’ll elaborate on it some other time)

Arranged Scissors 1 – The Common Minimum Programme

Arranged Scissors 2

Arranged Scissors 3 – Due Diligence

Arranged Scissors 4 – Dear Cesare

Arranged Scissors 5 – Finding the Right Exchange

Arranged Scissors 6: Due Diligence Networks

Arranged Scissors 7: Foreign boys

Meeting Sickness

Ok here is another reason I can think of as to why I didn’t do well in my consulting career. This is based on something I’ve been observing at office over the last week or two. I suffer from what I call as “meeting sickness”. The inability to work immediately after a meeting.

Rough empirical analysis tells me that for every meeting of N minutes that I sit through, I need another N minuts of downtime following it before I can get back to work. I don’t know why this happens to me. I don’t know if I’m having to spend too much willpower inside the meeting. Or if it is just that at meetings i get into high-intensity mode and that drains me out.

Whatever it is, in a typical consulting environment, you are expected to attend lots of meetings. If you work for a company that believes in the philosophy that all work is to be done at the client’s location (such as AT Kearney) then you have meetings throughout the day. it is only in between meetings that you get time to work, and usually the way the projects have been sold means that you can’t afford any downtime.

So that explains it. The other big reasons I’ve come up with for my failure in consulting environment are it requires a high degree of willpower which I dont’ have; and that it is an essentially fighter job. Maybe these are inter-related. Need to think on these lines and come up with something.

And if you didn’t like this post, my apologies. I had an extra-long meeting at work this evening from 4 to 7 (and had sat through three other meetings since morning). I fled immediately after, but I’m yet to recover.