What is a theory of change?

Policy interventions are sometimes pitched as magic solutions: 'If you lower taxes enough, the economy will automatically create jobs.' Or 'if you give students computers, they'll automatically get better grades at school.' This is the language favoured by politicians, who need to have catchy headlines next to their photos in newspapers. This is simple language.

When it comes to formulating and implementing your intervention in the real world, these simple mental models don't work anymore. Things should no longer be thought of as automatic. There should be something in the middle that joins our lever to a fulcrum that makes it pull a rope that opens a lid that lets the food fall down into your cat's bowl. Thus, policy analists (contrary to politicians) tend to see interventions as Rube Goldberg machines:

Our Rube Goldberg machines are called theories of change (ToC.) They simplify how the world works so we can figure out how our intervention is supposed to cr…

Tackling the COVID-19 crisis collaboratively

This weekend was a little bit different for me. I signed up for the COVID-19 Policy Hackathon organised by the Stanford University Economics Association, the MIT Undergraduate Economics Association, and the Business Association of Stanford Entrepreneurial Students. This was a collaborative exercise in which you teamed up with people from all over the world to come up with policy proposals. The proposals had to be aimed at addressing pressing social issues caused by the COVID-19 pandemic.
My team's policy memo can be found here. We proposed an ammendment to the CARES Act to help the Navajo nation combat the crisis more effectively. The Navajo nation (Arizona, Utah, New Mexico) has an alarmingly high infection rate (see US map) and, as of June 14, 311 deaths out of a population of just under 200,000. There were lots of excellent proposals coming from other teams. One of them that's particularly clever is this one by team 75.
I'm so grateful for this amazing opportunity. Perhap…

Flatten the curve in your browser here!

'Flattening the curve' has been the reason why we've been encouraged to stay home and restrict our social interactions. When you flatten the curve, you make sure that not too many people get COVID all at the same time, and that's good for your country's healthcare system.
To understand the spread of an epidemic, scientists use a variety of mathematical models, the simplest of which is the SIR model. SIR stands for Susceptible, Infected and Recovered, which are the three states that every person in the country can take. Like this:

You start being susceptible. With a certain probability (infection rate,) you become infected. And then, you recover, according to the recovery rate. With some illnesses, post-infection immunity isn't granted, so there's a loss of immunity rate as well. If you lose your immunity, you become susceptible again.
The curve that we are interested in is the I curve.
Now it's time to flatten it. I've created a dynamical model with 10,…

What is a ratio?

When doing data science, understanding the concept of ratio can be useful. We use ratios to mean how much of something there is for a certain amount of another thing. For example, in a pair of shoes there is one shoe for each foot, so there is a ratio of 1 to 1. If you happen to have lots of pairs of shoes, say 48 pairs, the ratio between your 94 shoes and your two feet is indeed 48 shoes for each 1 foot.
Ratios are usually expressed like a:b and are read 'a to b' or 'there are a units for each b units.' So, the ratio between shoes and feet would be 48:1 (forty-eight to one) because you have 48 left shoes and 48 right shoes, that is, 48 shoes for each one of your feet.

The women:men ratio in the world is roughly 52:50 (fifty-two to fifty) meaning that for each 50 men there are 52 woman. You can simplify this ratio and divide both terms by a common divisor and get a ratio of 26:25, which is equivalent.
Think of a bowl filled with balls. There are 11 balls inside it, 4 are …

Some intuition on time series analysis

Time series are table columns that can be plotted against time. When we analyse them, we often want to forecast their values. How do we do it? Read on.
There are basically three strategies to forecast time series: i) Use your judgement, ii) predict using other variables (eg., predict the price of cars with data about the price of steel,) and iii) use the past values of the time series itself. The first one is too subjective, and the second one tends to be too complex (it makes use of bias-prone econometric techniques.) So most of the time we go for the third option, which is called, in parlance, extrapolation.
You can extrapolate by finding a trend in the past data, weighting each value equally, and applying it to the future. Or by using autoregression, which means that you use the raw past values to do the prediction. Or you can apply moving averages, which is like autoregression, only now you smooth the past values to reduce the noise in them. But oftentimes the most convenient method…