INTERACTIVE ANIMATION: THE GAMMA DISTRIBUTION
This animation illustrates the Gamma distribution.
Foreword
In fact, we only illustrate the following special case of the Gamma distribution :
* Let Xi (i = 1, 2, ...n) be n independent exponentially distributed random variables.
Xi ~ Exp(
)
Denote X the r.v. defined as the sum of the Xi :
X =
i
Xi
Then X is Gamma distributed with parameters
n and
:
X ~ Gamma(n,
)
For a proof,
see the special case of the Gamma distribution when α is an integer.
This is a special case because α is here constrained to be a positive integer n, while in the general case, it can be any positive real number. The expression for the probability density function is now :

owing to the properties of the Gamma function.
_________________________________________
Upper frame
The n iid exponentially distributed r.v. are simulated by drawing a n-point sample from the single exponential distribution in the upper frame.
Lambda
The value of
is just
the height of the point where the exponential curve meets the vertical axis (intercept).
Mean
Recall that the mean of the distribution is 1/
.
It is displayed as a vertical blue line. Change the value of
by
sliding the mean with your mouse positioned just over the top of the displayed value
of the mean.
Sample size
Adjust n, the sample size, with the "Nb. Points" control buttons.
Lower frame
Gamma distribution
The
red curve is the Gamma distribution for the selected values of
and
n.
Mean
The
mean value is n/
, and is displayed as a vertical
blue line.
Mode
We
leave as an exercise to show that the mode is (n-1)/
.
It is therefore always less than the mean, as expected from a positively skewed
bell-shaped distribution.
Special case n = 1
When
n = 1, the Gamma distribution is just the exponential distribution Exp(
).
Animation
After choosing the values of
and n, click on "Go"
and watch the build-up of the histogram of the corresponding Gamma distribution.
Note that in the "Next" mode, the
value of X is displayed between the upper and lower frames.
Warning : the horizontal and vertical scales are
different in the upper and lower frames.