Gamma Distribution
In the world of probability and statistics, the Gamma Distribution is crucial in various fields, such as engineering, finance, and biology. Whether you're dealing with waiting times, lifetimes of products, or modelling certain processes, the Gamma Distribution can be a powerful tool. This blog will delve into the Gamma Distribution—its properties, its formula, and how to use it effectively.
1.0What is the Gamma Distribution?
The Gamma Distribution is a continuous probability distribution that is characterised by two parameters. It's often used to model waiting times or lifetimes of events that occur at a constant rate. The distribution is commonly used in queuing theory, reliability analysis, and Bayesian statistics.
The Gamma Distribution has two key parameters:
- Shape Parameter (k or α): Determines the shape of the distribution.
- Rate Parameter (λ or β): Determines the rate of events.
When both parameters are integers, the Gamma Distribution becomes a Gamma Process, often used in the analysis of the lifetimes of systems or events.
2.0Gamma Distribution Probability Density Function (PDF)
The Probability Density Function (PDF) for the Gamma Distribution is the mathematical expression that defines the distribution’s behavior. It is given by the formula:
f(x;k,λ)=Γ(k)λkxk−1e−λx
Where:
- x ≥ 0
- k is the shape parameter
- λ is the rate parameter
- Γ(k) is the Gamma function evaluated at k, which generalizes the factorial function to non-integer values.
3.0CDF of Gamma Distribution
The Cumulative Distribution Function (CDF) of the Gamma Distribution is the integral of the PDF. It represents the probability that the random variable X takes a value less than or equal to a particular value x. The CDF of the Gamma Distribution is expressed as:
F(x;k,λ)=Γ(k)γ(k,λx)
Where:
- γ(k,λx) is the lower incomplete Gamma function.
This function is crucial when calculating the probability of a given range of values for the Gamma random variable.
4.0Expectation and Mean of Gamma Distribution
The Expectation (or Mean) of a Gamma Distribution provides the central tendency or the average value of the random variable. The mean of the Gamma Distribution is given by:
E[X]=λk
Where k is the shape parameter, and λ is the rate parameter. This formula shows that the mean depends directly on the shape and rate of the distribution.
5.0Gamma Distribution Formula
The Gamma Distribution formula combines both the PDF and CDF, and it serves as the backbone of the distribution's application.
As mentioned earlier, the Gamma Distribution PDF is:
f(x;k,λ)=Γ(k)λkxk−1e−λx
And the CDF is:
F(x;k,λ)=Γ(k)γ(k,λx)
Example of Gamma Distribution
Let’s look at an example of Gamma Distribution to better understand its application.
Suppose a server in a data center receives requests at an average rate of 2 requests per minute. If the waiting time between requests follows a Gamma Distribution with shape parameter k = 3 and rate parameter λ = 2, then we can calculate the probability of waiting less than 5 minutes for the next request.
Using the Gamma Distribution CDF, we can determine this probability:
F(5;3,2)=Γ(3)γ(3,2×5)
By evaluating this, we find the cumulative probability.
6.0Inverse Gamma Distribution
An interesting extension of the Gamma Distribution is the Inverse Gamma Distribution. While the Gamma Distribution models waiting times or lifetimes, the Inverse Gamma Distribution models the reciprocal of these quantities, and it’s used in fields like Bayesian statistics.
The Inverse Gamma Distribution has the following PDF:
f(x;α,β)=Γ(α)βαx−(α+1)e−xβ
Where α is the shape parameter and β is the rate parameter. The inverse distribution is often used to model variance, and it can be helpful in situations where the distribution of a quantity is expected to be highly skewed.
7.0Gamma Distribution Parameters
The two primary parameters that define the Gamma Distribution are the shape parameter k (or α) and the rate parameter λ (or β). The Gamma Distribution Parameters determine the overall shape and spread of the distribution, which in turn influences its applications:
- The Shape Parameter controls how "peaked" or "spread out" the distribution is.
- The Rate Parameter controls the scale and how fast the events occur.
Key Properties of the Gamma Distribution
- Skewness: The Gamma Distribution is skewed, and its skewness decreases as the shape parameter k increases.
- Variance: The Variance of the Gamma Distribution is given by λ2k, which also depends on the shape and rate parameters.
8.0Solved Examples on Gamma Distribution
Example 1: Suppose the waiting time for the next customer at a service center follows a Gamma Distribution with a shape parameter k = 2 and a rate parameter λ = 3. Find the following:
- The probability that the waiting time is less than 1 unit of time (i.e., P(X < 1)).
- The expected waiting time (i.e., the mean of the distribution).
- The variance of the waiting time.
Solution:
Step 1: Define the Problem
The given information is:
- Shape parameter (k) = 2
- Rate parameter (λ) = 3
We need to calculate:
- Probability P(X < 1), i.e., the CDF at x = 1.
- The mean of the Gamma Distribution.
- The variance of the Gamma Distribution.
Step 2: Calculate the Probability P(X < 1)
We use the Cumulative Distribution Function (CDF) of the Gamma Distribution to find the probability that the waiting time is less than 1. The CDF is given by:
F(x;k,λ)=Γ(k)γ(k,λx)
Where:
- γ(k,λx) is the lower incomplete Gamma function.
- Γ(k) is the Gamma function, which is the generalization of the factorial.
For our case:
First, we calculate the CDF at x = 1:
F(1;2,3)=Γ(2)γ(2,3×1)=1!γ(2,3)
Since Γ(2) = 1, we just need to evaluate the incomplete Gamma function γ(2, 3).
The lower incomplete Gamma function γ(2,3) is equal to:
γ(2,3)=∫03t2−1e−tdt=1−e−3(1+3)
Using this, we find that:
γ(2,3)=1−e−3(4)≈1−0.0498(4)≈1−0.1992≈0.8008
Therefore, the CDF at x=1x = 1 is approximately:
F(1; 2, 3) = 0.8008
Thus, the probability that the waiting time is less than 1 unit of time is:
P(X < 1) ≈ 0.8008
Step 3: Calculate the Expected Waiting Time (Mean)
The mean (expectation) of the Gamma Distribution is given by the formula:
E[X]=λk
Substituting the values:
E[X]=32≈0.6667
Thus, the expected waiting time is approximately 0.6667 units of time.
Step 4: Calculate the Variance of the Waiting Time
The variance of the Gamma Distribution is given by:
Var(X)=λ2k
Substituting the values:
Var(X)=322=92≈0.2222
Thus, the variance of the waiting time is approximately 0.2222 units of time squared.
Final Answers:
- The probability that the waiting time is less than 1 unit of time is 0.8008.
- The expected waiting time (mean) is 0.6667 units of time.
- The variance of the waiting time is 0.2222 units of time squared.
Example 2: Show
∫0∞Γ(α)βα1xα−1e−x/βdx=1
Solution.
Let t=βx⇒x=βt,dx=βdt Then integrand becomes
Γ(α)βα1(βt)α−1e−tβ
=Γ(α)1tα−1e−t.
Integrate t from 0 to ∞ gives Γ(α)Γ(α)=1. QED.
Example 3: For X∼Γ(α,β) compute E[X] and Var(X).
Solution. Use known results or compute via moments:
E[X]=∫0∞xfX(x)dx=Γ(α)βα1∫0∞xαe−x/βdx.
With substitution t=x/β:∫xαe−x/βdx=βα+1Γ(α+1). So
E[X]=Γ(α)βαβα+1Γ(α+1)=βΓ(α)Γ(α+1)=βα.
Similarly E[X2]=β2α(α+1). Thus
Var(X)=E[X2]−E[X]2=β2α(α+1)−(αβ)2=αβ2.
Example 4: X∼Γ(n,β)withintegern.ComputeP(X≤t) (closed form using sums).
Solution. For n integer, CDF is FX(t)=1−e−t/β∑k=0n−1k!(t/β)k.
Derivation: use relation to sum of nn independent Exponential (1/\beta) waiting times (Poisson process); complementary probability equals probability of fewer than n arrivals by time t. So formula above is standard (Erlang CDF).
Example numeric: for n=3,β=2,t=4,
F=1−e−2(1+1!2+2!22)=1−e−2(1+2+2)=1−5e−2.
Example 5: Let Y1,…,Yn be i.i.d. Exp(λ) (rate λ ). Show S=∑i=1nYi∼Γ(n,1/λ).
Solution. PDF of Exp(λ) is λe−λy. The convolution of n identical exponentials gives Erlang with shape nn and scale 1/λ. Equivalently, Laplace transform: LYi(s)=λ/(λ+s). Product for sum is (λ/(λ+s))n which is Laplace of Γ(n,1/λ). Hence S has PDF
fS(x)=(n−1)!λnxn−1e−λx,x>0.
Example 6: Find the mode (value of x maximizing the PDF) of Γ(α,β) for α>1.
Solution
Differentiate log-PDF:
f(x)=−αlnβ−lnΓ(α)+(α−1)lnx−x/β.
Set derivative = 0:
xα−1−β1=0⇒x=(α−1)β.
For α>10<α≤1 this gives the unique interior maximum. If 0<α≤1 the density is decreasing so mode at x = 0.
Example 7: Show that if X∼χν2 (chi-square with v degrees), then X∼Γ(α=ν/2,β=2).
Solution
Chi-square PDF:
f(x)=2ν/2Γ(ν/2)1xν/2−1e−x/2,x>0,
which matches Gamma with α=ν/2,β=2. So all chi-square properties follow from Gamma.
Example 8: Find MGF MX(t)=E[etX], for Gamma (α,β) and use it to compute E[X].
Solution. For t<1/β.
MX(t)=∫0∞etxΓ(α)βα1xα−1e−x/βdx=Γ(α)βα1∫0∞xα−1e−x(1/β−t)dx.
Let c=1/β−t>0. Then integral =Γ(α)c−α So
MX(t)=(1−βt1)α,t<1/β.
Differentiate at t = 0:
E[X]=MX′(0)=αβ, agreeing with previous result.
Example 9: Suppose X1,…,Xni.i.d.Γ(α,β) with known α and unknown β (scale). Find the MLE β^.
Solution.
Likelihood:
L(β)∝β−nαexp(−β1∑ixi).
Log-likelihood:
ℓ(β)=−nαlnβ−β1∑iXi+const.
Differentiate w.r.t. β and set 0:
−βnα+β21∑iXi=0⇒β^=nα1∑i=1nXi=αXˉ.
So MLE β^=Xˉ/α. (Check the second derivative negative ⇒ maximum.)
Example 10: Let X∼Γ(4,2). Compute P(X > 6).
Solution.
For integer shape n = 4 use Erlang complementary form:
P(X>6)=e−6/2∑k=03k!(6/2)k=e−3∑k=03k!3k.
Compute terms: 30/0!=1,31/1!=3,32/2!=9/2=4.5,33/6=27/6=4.5. Sum = 1 + 3 + 4.5 + 4.5 = 13. So
P(X>6)=13e−3≈13×0.0497871≈0.6472.
(You can leave answer as 13e−3 or approximate.)
Also Read: