Welcome to The Nonlinear Library, where we use Text-to-Speech software to convert the best writing from the Rationalist and EA communities into audio. This is: Type Checking GiveWell's GiveDirectly Cost Effective Analysis, published by Hazelfire on the Effective Altruism Forum. 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: You can only equate, add or subtract numbers that have the same units 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 4 × 5 20 apples. In this case we multiplied the units together a p p l e s b a g × b a g s a p p l e s 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. a p p l e s b a g b a g s 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 8 × 5 40 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. a p p l e s b a g b a g s a p p l e s 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 4 5 9 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 8 5 13 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", ...