Basic Concepts
The gamma distribution has the same relationship to the Poisson distribution that the negative binomial distribution has to the binomial distribution. The gamma distribution directly is also related to the exponential distribution and especially to the chi-square distribution.
Definition 1: The gamma distribution has a probability density function (pdf) defined by
for positive values of x where α (the shape parameter) and β (the scale parameter) are also positive numbers.
Worksheet Functions
Excel Functions: Excel provides the following functions for the gamma distribution:
GAMMA.DIST(x, α, β, cum) = the pdf f(x) of the gamma distribution when cum = FALSE and the corresponding cumulative distribution function (cdf) F(x) when cum = TRUE
GAMMA.INV(p, α, β) = x such that GAMMA.DIST(x, α, β, TRUE) = p. Thus GAMMA.INV is the inverse of the cdf of the gamma distribution.
These functions are not available in versions of Excel prior to Excel 2010. Instead, these versions of Excel use GAMMADIST, which is equivalent to GAMMA.DIST, and GAMMAINV, which is equivalent to GAMMA.INV.
Key statistical properties of the gamma distribution are:
- Mean = αβ
- Variance = αβ2
- Skewness = 2 / √α
- Kurtosis = 6 / α
Observation: If λ is a constant that represents the average number of random events that occur in a fixed time interval (i.e. following a Poisson process) then the probability that the kth such event will occur in less than x time is given by F(x) where F is the cumulative gamma distribution function with parameters α = k and β = 1/λ.
Example
Example 1: Suppose that sending a money order is a random event and that at a particular shop someone sends a money order on average every 15 minutes. What is the probability that the shop sends a total of 10 money orders in less than 3 hours?
For this example, λ = 4 money orders per hour. Let x = the time to send 10 money orders and let F(x) be the cumulative gamma distribution function with α = k = 10 and β = 1/λ = .25. Thus
P(x<3) = F(3) = GAMMA.DIST(3, 10, .25, TRUE) = .7586
and so the probability is 75.86%.
Examples Workbook
Click here to download the Excel workbook with the examples described on this webpage.
Reference
Wikipedia (2012) Gamma distribution
https://en.wikipedia.org/wiki/Gamma_distribution
Can I use real stats to find the threshold or location parameter as well as shape and scale when fitting the gamma distribution? This is important in material science in which a threshold minimum strength must be known.
Hello Tim,
Currently, Real Statistics only estimates the parameters of the two-parameter gamma distribution.
I believe that the following article explains how to handle the three-parameter gamma distribution:
https://www.jstor.org/stable/1266594
I will look into adding such support.
Charles
How can I find the confidence interval for gamma distribution..what is foula for calculating confidence interval for gamma..like we can calculate CI for Poisson by χ2p,df = CHIINV(1−p,df)
Hello Anu,
Perhaps you are looking for the following.
https://www.real-statistics.com/distribution-fitting/distribution-fitting-confidence-intervals/
Charles
Thanks a lot for guidance
As explained by you, for Poisson we are using formula
(qchisq(α/2, 2*x)/2, qchisq(1-α/2, 2*(x+1))/2 )
Where x is the number of events occurred under Poisson distribution.
I am looking something similar for gamma, basically find the Confidence Interval for gamma Mean
Hello Anu,
Perhaps the following webpage will be helpful.
https://www.researchgate.net/post/How-can-I-get-a-confidence-interval-CI-for-gamma-distributed-data
Charles
Greetings All:
Is there any way in Excel to calculate the gamma function and/or gamma distribution for negative shape parameter (alpha)? It appears that some software systems can do it (e.g. Wolfram), but I can’t find a way to do it in Excel. Any advice would be greatly appreciated.
Hello Dan,
The gamma function for negative values is described at
https://www.real-statistics.com/other-key-distributions/gamma-function/gamma-function-advanced/
It also described how to compute it in Excel.
Charles
Many thanks for your prompt and helpful reply!
The site provides the complete gamma for negative alpha, which is excellent. But what about the gamma distribution, or more specifically for my problem, the upper incomplete gamma function with negative alpha and positive x between 0 and 1?
See https://arxiv.org/pdf/1407.0349
Charles
Hi all,
Would you mind helping me on the alpha and beta parameters calculation ?
I have a time series that I suspect follows a Gamma distribution, but I have no clue how to calculate these two parameters.
Thank you in advance.
Hello Roberto,
Here are two approaches:
https://real-statistics.com/distribution-fitting/method-of-moments/
https://real-statistics.com/distribution-fitting/distribution-fitting-via-maximum-likelihood/fitting-gamma-parameters-mle/
Charles
If I am seeking to create a gamma distribution in Excel, how would I accomplish this? For example, I am seeing to create a set of sample data for wages (which often has a gamma type distribution). I know what the 10th, 25th, 50th, 75th and 90th percentile wages are…
Niraj,
You can use the approaches described on the following webpages:
https://real-statistics.com/distribution-fitting/method-of-moments/
https://real-statistics.com/distribution-fitting/distribution-fitting-via-maximum-likelihood/fitting-gamma-parameters-mle/
Charles
Dr buenas noches, muchas gracias por su página.
Dr,Real Statistics cuenta con la regresión de Poisson?
Gracias
Dr Good evening, thank you very much for your page.
Dr, Real Statistics has the Poisson regression?
Thank you
Gerardo,
Real Statistics doesn-t yet support Poisson regression, but I do plan to add this shortly.
Charles
DR. Muchas gracias, sin embargo pensé que por modelo log-lineal, podría aplicarla.
Gracias
DR. Many thanks, however I thought that by log-linear model, I could apply it.
Thank you
Why is so little emphasis placed on the Gamma distribution? Does it not play much of a role in statistics?
It is important for population modeling and queuing theory. But I suppose these are more of mathematical models than they are statistics.
Empirically speaking
k=μ * lambda
When k=1 this is the exponential distribution.
k>=20 is essentially normal
And k<1 suggests a branching process following a Borel distribution or a more complicated distribution that takes lifespan and age into account.
Anthony,
Thanks for your comments. The gamma distribution does play a role in statistics (esp. the exponential distribution), but not so much in the topics we have covered thus far. When I was working in a company where queueing models were used, this distribution was very important.
Charles
So the Excel notation is alpha_Excel = shape = alpha_Wikipedia and beta_Excel = scale = 1/beta_Wikipedia?
Elsa,
Yes, the Excel notation is the opposite of others.
Charles
Cleared up so much confusion. Still don’t understand why Microsoft/Excel doesn’t conform to more common statistical notation.
Hello Grant,
Glad I could help. Not sure how Microsoft makes some of these decisions.
Charles
This was extremely helpful thank you very much!!