Member-only story
In my last post I discussed how to create a beta distribution in Excel and that post can be viewed here:- https://medium.com/@tracyrenee61/create-the-beta-distribution-in-excel-f2f566417099
In this post I intend to discuss how the gamma distribution can be created in Excel.
The gamma function, being a generalisation of the factorial function to non integral values, was introduced by Swiss mathematician Leonhard Euler in the 18th century.
The gamma distribution is a continuous probability distribution that models right skewed data. This distribution has been used to model cancer rates, insurance claims, and rainfall. The gamma distribution is similar to the exponential distribution and it can be used to model failure times, wait times, service times, etcetera.
The most frequent use of the gamma distribution is to model the time between independent events that occur at a constant average rate. Using this distribution, analysts can specify the number of events, such as modelling the time until the second and third accident occurs, thereby modelling failure times.
The gamma distribution, being a generalisation of the exponential distribution, can model the elapsed time between various numbers of events. The exponential distribution, however, can only model the time until the next event, such as when the next accident will occur.
The formula for the gamma distribution is:-
In order to create a gamma distribution, it is first necessary to enter the alpha (shape) and beta(scale) of the distribution. In this example I defined alpha as being 5 in cell E3 and beta as being 2 in cell F3.
The input values needed to be entered into the spreadsheet. I have entered the following formula in cell A3 and copied it down to cell A104, which inputs an integer between ) and 40 in each cell:-
=RANDBETWEEN(0,40)
Once the alpha, beta, and input values have been entered into the spreadsheet, I have entered the formula for the gamma probability distribution function (PDF) in cell B3 and copied…