---
title: "Sum of a number of independent random variables"
canonical: "https://modelassist.epixanalytics.com/space/EA/26575618/Sum%20of%20a%20number%20of%20independent%20random%20variables"
format: markdown
---
We are very frequently interested in the value of the total of a number of independent identically distributed random variables (sometimes known as iid's in statistics). By "independent', we mean that each random variable will take a value that is not influenced by the value of any of the other random variables. Some examples are:

 

- The total purchases by n customers where we know the probability distribution of the purchase amount from a random customer;
- The amount of water drunk by the citizens of a town of size n where we know the probability distribution of the amount of water drunk by a random citizen;
- The price of yearly maintenance of a fleet of n similar vehicles where we know the probability distribution of the yearly maintenance cost of a random, similar vehicle.

 

A frequent mistake in risk modeling is to take the probability distribution of the individual iid and multiply by n. For example, if the purchase amount of a random customer is known to be $Lognormal(20,35), and we want to know the total purchase for 1000 customers, we might think to perform the following calculation:

Total purchase ($) = Lognorm(20,35)*1000

 

![image](media://973e0067-b56b-4ed5-8600-9a90fd89c04f)

 

The above graph shows that there is an 8.6% probability that a random purchase is above $50 and a 33.5% probability of being below $6. The RiskLognorm(20,35)*1000 formula will generate a value of $50,000 with 8.6% probability, i.e. it would be allocating the same probability of all 1000 customers coming in and spending around $50+ as just one customer. The formula ignores the fact that some customers will make small purchases and others large purchase, so they will even out to something closer to the average of $20.

 

The correct way to model the total customer purchases is to write 1000 =RiskLognorm(20,35) distributions, each in its own spreadsheet cell, and then write another cell that adds them all up. Of course, this is a calculation intensive exercise. Since N (=1000) is a large number, we could use [Central Limit Theorem](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574953/) (CLT) instead, and simply write the sum in one line: =Normal(1000*20, SQRT(1000)*35).

 

The figure below plots the cumulative distributions of the incorrect [=Lognorm(20,35)*1000] and correct [either =Normal(1000*20, SQRT(1000)*35) or summing 1000 Lognorm(20,35) distributions] ways of modeling this sum. The results were obtained by running 10,000 iterations in Crystal Ball. The results have the same mean, but the correct method has a far narrower distribution. In fact, it has a standard deviation that is 

![image](media://65840ce0-8f25-4ad5-8535-c208fd971184)

> Macro (mathinline)

 , or about 32 times smaller! The almost perfect overlay between the two correct methods also shows that the CLT approximation works extremely well because a large number of distributions (1000) are being added together, even though those distributions (Lognormal(20,35)) are quite skewed.

 

![image](media://0177c207-6c5a-4356-aef8-b5c05352f771)

 

 

 

---