Hide table of contents

tldr: You can check for the consistent use of units to find assumptions and/or errors within calculations. I use this on GiveDirectly's Cost Effective Analysis by GiveWell to find two implicit assumptions that impact the result. I think they should probably be included explicitly within the model, and that this technique could be used for other Cost Effectiveness Analysis. If you are not interested in the specifics of how the effectiveness of charities are calculated, you will probably find this read a waste of time.

Numerical models could describe the world, or it might not describe the world. However, there's an interesting way that you can work out whether your model does describe the world without even looking at any data.

To do that, we turn to the field of Dimensional Analysis. Dimensional Analysis is based off really simple ideas. Basic Dimensional Analysis pretty much has two rules:

  1. You can only equate, add or subtract numbers that have the same units
  2. Multiplying/dividing numbers means multiplying/dividing their units

We use dimensional analysis all the time. If I have 4 apples per bag, and 5 bags, then we  apples. In this case we multiplied the units together

This is the second rule above. We however, cannot add units that are different. It doesn't make sense to say that I have 4 apples per bag + 5 bags.

We do not know what the units of the result would be. This is the first rule above. What's great about physical equations is that you can vary the units of the equation and it still means the same thing. Say instead of talking about apples, you cut each apple in half and talk about apple halves. This changes the units from apples to apple halves. So we would have 8 apple halves per bag and 5 bags. How many apple halves do you have? Well, we have  apple halves, which is exactly the same prediction as 20 apples. The fact that we can change our units without changing the meaning of a physical equation I'll call "scale invariance".

If you have equations that are not physical, then that law can be violated. For instance, if we assumed (wrongly) that we can add the apples per bag and bags to get apples.

Then scale invariance will be violated. Because in the first example, if you have 4 apples per bag, and 5 bags, this would predict you would have  apples in total. However, if we start talking about apple halves, and say we have 8 apple halves per bag, then the equation would give  apples halves. 13 apple halves is not the same as 9 apples. Therefore scale invariance has been violated and this equation therefore must be wrong.

If dimensional analysis is not followed, then simply changing the units of your equation would change it's results! An equation that follows these rules is deemed "physical".

In physics, this is such a powerful tool in finding incorrect equations, that it's possible to derive many equations by looking at the units of the parameters alone. I was particularly blown away by an example of deriving the range equation from the units of it's parameters on Wikipedia.

I'm from a software background, so I like to consider this as type checking math. Hence the title.

There are a lot of long calculations done in Cost Effectiveness Analysis (CEAs). As of such, I investigated as to whether these calculations were physical for GiveDirectly. That is, do these calculations abide by the rules of Dimensional Analysis.

Dimensional Analysis has two important but distinct concepts, "units" and "dimensions". Examples of dimensions include "length", "time", "money". Examples of units include "meters", "feet", "seconds", "years" etc. Each unit belongs to a dimension.

A quick overview of GiveDirectly's CEA

Before going further, if you're not familiar with GiveWell's CEAs, here's a quick overview of the way GiveDirectly's cost effectiveness is calculated. It's deliberately only the parts that are needed to understand this post. If you want the full details, you can take a look at their spreadsheet.

The calculation is done by modeling giving funds to the recipient. The recipient then invests a portion of the funds and uses the other portion. The portion that they use increases their consumption by a certain amount. The investment, which could be things such as fixing a roof or investing in their business, allows them to increase their consumption over a longer period of time. After the benefits end from the investment, a certain amount of the investment's worth is returned to the recipient, also increasing their consumption. 

The total increased consumption is the increase consumption from the money not invested, plus the amount of consumption increased from the investment, plus the amount of consumption increased when the benefits end. The value of the donation is calculated by multiplying this total increased consumption by a moral weight, indicating the value of the increase of consumption.

Checking Scale Invariance

Thankfully, there's a simple way of checking whether a numerical model is physical. All we need to do is change the units of the calculation and see if the result changes because of it. If it does, the calculation violates scale invariance, and for some reason the result depends on the units of measure that are used to calculate it.

GiveWell's CEAs all have a "total units of value generated" as the result of their calculations. This result is in "Value" units. This means that if I change the definition of units in other dimensions (such as swapping out Time in years for Time in days), then it shouldn't impact that result. If it does, we have a problem!

It should be noted that this does not guarantee that GiveDirectly's model is correct if this check passes. This is a very rudimentary check, in fact Wikipedia calls it a "sanity check". Just because your program compiles doesn't mean it's correct.

Results

So, is GiveDirectly's CEA physical? Does it abide by the laws of Dimensional Analysis?

Well, actually no, but honestly not so much in a bad way. The resulting spreadsheet is here.  The model is scale invariant for money, households and people but not time. Meaning if I set the time units to be anything that's not years, the value calculated will change. The reason for this is because there's two implied parameters that are not included in the model. Those parameters are:

  • Time for which the recipient consumption is increased from funds not invested
  • Time for which the recipient consumption is increased from the funds returned from the investment when benefits end

These two values were left unspecified, and therefore assumed whatever 1 was in
the current units for time (which in this case, is the reasonable 1 year). If I changed the units down to days, then that meant that these parameters would change to 1 day, changing the results.

The results depend on these two parameters because wellbeing is measured as a log increase in consumption. This means that if consumption is increased but only in a short period of time, the wellbeing isn't as large as a small consumption increase over a long period of time. I've made a graphical and interactive explanation of the concept here.

Including those two parameters fixes scale invariance under time. Although it might seem pedantic, I think GiveWell should include these two parameters in their model explicitly, because they do change the result of the calculation when changed.

Assuming these parameters are one year, which I believe is a fair assumption, This doesn't change the cost effectiveness of GiveDirectly at all. Although it might mean that these parameters need to be justified in some way.

Problems and caveats

Just a warning, this section is a bit technical, and requires a proper understanding of how GiveDirectly's cost effectiveness is calculated.

To do this analysis, I had to change the definition of the Present Value slightly. Instead of using a discrete Present Value, calculating what would happen if you get discrete payouts at the end of the year, I chose a continuous option, which is like if I got millions of tiny payouts that slowly decreased over time. This gets very similar results, but bumps the total units of value for GiveDirectly up by a few points. A discrete version of the CEA is still valid under the rules of Dimensional Analysis, it just meant that the units of the discount rate became incredibly complicated, and something I couldn't even solve for.

The calculation for the discrete Present Value, for payment , rate  and duration  is:

Whereas the continuous version of the same quantity is:

Although I did this for mathematical convenience alone, I think that this might model the benefits likely received better than a more discrete model. This is because the investment's discussed when looking at GiveDirectly are not so much like receiving benefits at the end of every year, but increased consumption from not spending time and money repairing roofs. That being said, for someone with an economics background, the PV function might make more sense than the continuously equivalent integral. For a  discount rate of 4%, the continuous version is 2% larger.

I'm fairly certain that my patched model still has problems. These problems are however minor considering the uncertainty of the parameters and the model itself.

One problem I can name is that the recipient is modeled to increase consumption from the investment and from money not invested in the first year. However the increase in consumption in the first year are both calculated as ratios from the baseline consumption, then multiplied (added under logs) together. Meaning that if the  is the baseline consumption,  is the consumption increased from investment and  is the consumption increased from funds transferred (not invested). The consumption in the first year is modeled as:

instead of:

this issue however is remarkably pedantic, and is pretty much
lost considering the uncertainty of the parameters and model in the calculation.

The model probably also has other issues. If you see any more, please let me know.

I think that dimensional analysis is a useful tool for investigating the validity
and assumptions of other CEA. I'd love to continue this technique with the other
models done by GiveWell.
 

Comments2


Sorted by Click to highlight new comments since:

Thanks for doing this analysis, and for writing up in such  a way as to introduce this technique to a wider audience!

Fascinating post, thank you! This was a great introduction to dimensional analysis for me.

Curated and popular this week
Paul Present
 ·  · 28m read
 · 
Note: I am not a malaria expert. This is my best-faith attempt at answering a question that was bothering me, but this field is a large and complex field, and I’ve almost certainly misunderstood something somewhere along the way. Summary While the world made incredible progress in reducing malaria cases from 2000 to 2015, the past 10 years have seen malaria cases stop declining and start rising. I investigated potential reasons behind this increase through reading the existing literature and looking at publicly available data, and I identified three key factors explaining the rise: 1. Population Growth: Africa's population has increased by approximately 75% since 2000. This alone explains most of the increase in absolute case numbers, while cases per capita have remained relatively flat since 2015. 2. Stagnant Funding: After rapid growth starting in 2000, funding for malaria prevention plateaued around 2010. 3. Insecticide Resistance: Mosquitoes have become increasingly resistant to the insecticides used in bednets over the past 20 years. This has made older models of bednets less effective, although they still have some effect. Newer models of bednets developed in response to insecticide resistance are more effective but still not widely deployed.  I very crudely estimate that without any of these factors, there would be 55% fewer malaria cases in the world than what we see today. I think all three of these factors are roughly equally important in explaining the difference.  Alternative explanations like removal of PFAS, climate change, or invasive mosquito species don't appear to be major contributors.  Overall this investigation made me more convinced that bednets are an effective global health intervention.  Introduction In 2015, malaria rates were down, and EAs were celebrating. Giving What We Can posted this incredible gif showing the decrease in malaria cases across Africa since 2000: Giving What We Can said that > The reduction in malaria has be
Rory Fenton
 ·  · 6m read
 · 
Cross-posted from my blog. Contrary to my carefully crafted brand as a weak nerd, I go to a local CrossFit gym a few times a week. Every year, the gym raises funds for a scholarship for teens from lower-income families to attend their summer camp program. I don’t know how many Crossfit-interested low-income teens there are in my small town, but I’ll guess there are perhaps 2 of them who would benefit from the scholarship. After all, CrossFit is pretty niche, and the town is small. Helping youngsters get swole in the Pacific Northwest is not exactly as cost-effective as preventing malaria in Malawi. But I notice I feel drawn to supporting the scholarship anyway. Every time it pops in my head I think, “My money could fully solve this problem”. The camp only costs a few hundred dollars per kid and if there are just 2 kids who need support, I could give $500 and there would no longer be teenagers in my town who want to go to a CrossFit summer camp but can’t. Thanks to me, the hero, this problem would be entirely solved. 100%. That is not how most nonprofit work feels to me. You are only ever making small dents in important problems I want to work on big problems. Global poverty. Malaria. Everyone not suddenly dying. But if I’m honest, what I really want is to solve those problems. Me, personally, solve them. This is a continued source of frustration and sadness because I absolutely cannot solve those problems. Consider what else my $500 CrossFit scholarship might do: * I want to save lives, and USAID suddenly stops giving $7 billion a year to PEPFAR. So I give $500 to the Rapid Response Fund. My donation solves 0.000001% of the problem and I feel like I have failed. * I want to solve climate change, and getting to net zero will require stopping or removing emissions of 1,500 billion tons of carbon dioxide. I give $500 to a policy nonprofit that reduces emissions, in expectation, by 50 tons. My donation solves 0.000000003% of the problem and I feel like I have f
 ·  · 8m read
 · 
In my past year as a grantmaker in the global health and wellbeing (GHW) meta space at Open Philanthropy, I've identified some exciting ideas that could fill existing gaps. While these initiatives have significant potential, they require more active development and support to move forward.  The ideas I think could have the highest impact are:  1. Government placements/secondments in key GHW areas (e.g. international development), and 2. Expanded (ultra) high-net-worth ([U]HNW) advising Each of these ideas needs a very specific type of leadership and/or structure. More accessible options I’m excited about — particularly for students or recent graduates — could involve virtual GHW courses or action-focused student groups.  I can’t commit to supporting any particular project based on these ideas ahead of time, because the likelihood of success would heavily depend on details (including the people leading the project). Still, I thought it would be helpful to articulate a few of the ideas I’ve been considering.  I’d love to hear your thoughts, both on these ideas and any other gaps you see in the space! Introduction I’m Mel, a Senior Program Associate at Open Philanthropy, where I lead grantmaking for the Effective Giving and Careers program[1] (you can read more about the program and our current strategy here). Throughout my time in this role, I’ve encountered great ideas, but have also noticed gaps in the space. This post shares a list of projects I’d like to see pursued, and would potentially want to support. These ideas are drawn from existing efforts in other areas (e.g., projects supported by our GCRCB team), suggestions from conversations and materials I’ve engaged with, and my general intuition. They aren’t meant to be a definitive roadmap, but rather a starting point for discussion. At the moment, I don’t have capacity to more actively explore these ideas and find the right founders for related projects. That may change, but for now, I’m interested in