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
 ·  · 16m read
 · 
This is a crosspost for The Case for Insect Consciousness by Bob Fischer, which was originally published on Asterisk in January 2025. [Subtitle.] The evidence that insects feel pain is mounting, however we approach the issue. For years, I was on the fence about the possibility of insects feeling pain — sometimes, I defended the hypothesis;[1] more often, I argued against it.[2] Then, in 2021, I started working on the puzzle of how to compare pain intensity across species. If a human and a pig are suffering as much as each one can, are they suffering the same amount? Or is the human’s pain worse? When my colleagues and I looked at several species, investigating both the probability of pain and its relative intensity,[3] we found something unexpected: on both scores, insects aren’t that different from many other animals.  Around the same time, I started working with an entomologist with a background in neuroscience. She helped me appreciate the weaknesses of the arguments against insect pain. (For instance, people make a big deal of stories about praying mantises mating while being eaten; they ignore how often male mantises fight fiercely to avoid being devoured.) The more I studied the science of sentience, the less confident I became about any theory that would let us rule insect sentience out.  I’m a philosopher, and philosophers pride themselves on following arguments wherever they lead. But we all have our limits, and I worry, quite sincerely, that I’ve been too willing to give insects the benefit of the doubt. I’ve been troubled by what we do to farmed animals for my entire adult life, whereas it’s hard to feel much for flies. Still, I find the argument for insect pain persuasive enough to devote a lot of my time to insect welfare research. In brief, the apparent evidence for the capacity of insects to feel pain is uncomfortably strong.[4] We could dismiss it if we had a consensus-commanding theory of sentience that explained why the apparent evidence is ir
 ·  · 40m read
 · 
I am Jason Green-Lowe, the executive director of the Center for AI Policy (CAIP). Our mission is to directly convince Congress to pass strong AI safety legislation. As I explain in some detail in this post, I think our organization has been doing extremely important work, and that we’ve been doing well at it. Unfortunately, we have been unable to get funding from traditional donors to continue our operations. If we don’t get more funding in the next 30 days, we will have to shut down, which will damage our relationships with Congress and make it harder for future advocates to get traction on AI governance. In this post, I explain what we’ve been doing, why I think it’s valuable, and how your donations could help.  This is the first post in what I expect will be a 3-part series. The first post focuses on CAIP’s particular need for funding. The second post will lay out a more general case for why effective altruists and others who worry about AI safety should spend more money on advocacy and less money on research – even if you don’t think my organization in particular deserves any more funding, you might be convinced that it’s a priority to make sure other advocates get more funding. The third post will take a look at some institutional problems that might be part of why our movement has been systematically underfunding advocacy and offer suggestions about how to correct those problems. OUR MISSION AND STRATEGY The Center for AI Policy’s mission is to directly and openly urge the US Congress to pass strong AI safety legislation. By “strong AI safety legislation,” we mean laws that will significantly change AI developers’ incentives and make them less likely to develop or deploy extremely dangerous AI models. The particular dangers we are most worried about are (a) bioweapons, (b) intelligence explosions, and (c) gradual disempowerment. Most AI models do not significantly increase these risks, and so we advocate for narrowly-targeted laws that would focus their att
 ·  · 10m read
 · 
Citation: McKay, H. and Shah, S. (2025). Forecasting farmed animal numbers in 2033. Rethink Priorities. The report is also available on the Rethink Priorities website. Executive summary We produced rough-and-ready forecasts of the number of animals farmed in 2033 with the aim of helping advocates and funders with prioritization decisions. We focus on the most numerous groups of farmed animals: broiler chickens, finfishes, shrimps, and select insect species. Our forecasts suggest almost 6 trillion of these animals could be slaughtered in 2033 (Figure 1).   Figure 1: Invertebrates could account for 95% of farmed animals slaughtered in 2033 according to our midpoint estimates. Note that ‘Insects’ only includes black soldier fly larvae and mealworms. Our midpoint estimates point to a potential fourfold increase in the number of animals slaughtered from 2023 to 2033 and a doubling of the number of animals farmed at any time. Invertebrates drive the majority of this growth, and could account for 95% of farmed animals slaughtered in 2033 (see Figure 1) and three quarters of those alive at any time in our mid-point projections. We believe our forecasts point to an urgent need to address critical questions around the sentience and welfare of farmed invertebrates. Our estimates come with many caveats and warnings. In particular: * Species scope: For practicality, we produced numbers only for a few key animal groups: broiler chickens, finfishes, shrimp, and certain insects (black soldier flies and mealworms only). * Sensitivity to insect farming growth: Our forecasts are particularly sensitive to the growth in insect farming, which is highly sensitive to the success of insect farming business models and their ability to attract future investment. The recent and forecasted estimates, with 90% subjective credible intervals, can be viewed below in Table 1.  Table 1: Estimates of recent and forecasted numbers of broiler chickens, finfishes, shrimps, and insects slau