Gamma Distribution
📂Probability DistributionGamma Distribution
Definition

For k,θ>0, it is called the Gamma Distribution which has the following probability density function Γ(k,θ).
f(x)=Γ(k)θk1xk−1e−x/θ,x>0
- Γ represents the Gamma function.
- The probability density function of the Gamma distribution can also be defined as follows for α,β>0. Essentially, it’s just a matter of whether it’s θ=β1.
f(x)=Γ(α)βαxα−1e−βx,x>0
Fundamental Properties
Moment Generating Function
- [1]: m(t)=(1−θt)−k,t<θ1
- [2]: If X∼Γ(α,β), then
E(X)=Var(X)=kθkθ2
- [3]: Let’s say we have a random sample X:=(X1,⋯,Xn)∼Γ(k,θ) that follows a Gamma distribution.
The sufficient statistic for (k,θ) is as follows: T.
T=(i∏Xi,i∑Xi)
Theorems
Scaling
- [a]: If X∼Γ(k,θ), then for scalar c>0, cX∼Γ(k,cθ)
- [b]: For all natural numbers k,
∫μ∞Γ(k)zk−1e−zdz=x=0∑k−1x!μxe−μ
- [c]: Γ(1,λ1)⟺exp(λ)
- [d]: Γ(2r,2)⟺χ2(r)
- [e]: If two random variables X1,X2 are independent and X1∼Γ(α1,1), X2∼Γ(α2,1), then
X1+X2X1∼beta(α1,α2)
Explanation
The Gamma Distribution is a function named after the Gamma function, and the fact that the integral of its probability density function equates to 1 originates from Euler integrals. Rather than having an intuitive meaning, it’s artificially derived due to its statistically useful properties. Such distributions are also referred to as Sampling Distributions, and the Gamma distribution, thanks to its unique shape, takes on various forms and provides many convenient properties.
Bayesian
In Bayesian analysis, it is also used as the conjugate prior distribution for the Poisson distribution.
Proofs
[1]
When t<θ1, let y:=xθ(1−θt) then dy=θ(1−θt)dx,
m(t)=====∫0∞etxΓ(k)θk1xk−1e−x/θdx∫0∞Γ(k)θk1xk−1ex(t−1/θ)dx∫0∞Γ(k)θk1xk−1e−xθ(1−θt)dx∫0∞Γ(k)θk1(1−θtyθ)k−1e−y1−θtθdy(1−θt1)k∫0∞Γ(k)θkθkyk−1e−ydy
According to Euler’s integration, ∫0∞Γ(k)1yk−1e−ydy=1.
m(t)=(1−θt)−k,t<θ1
■
[2]
Direct deduction.
■
[3]
Direct deduction.
[a]
If we set X∼Γ(k,θ) and c>0, then Y=cX,
mX(t)====∫0∞etxΓ(k)θk1xk−1e−x/θdx∫0∞etxΓ(k)(cθ)kckxk−1e−cx/cθdx∫0∞ectcxΓ(k)(cθ)k1(cx)k−1e−cx/cθcdx∫0∞ectyΓ(k)(cθ)k1yk−1e−y/cθdy
According to [1] the moment generating function,
mY(t)=====E(etY)E(etcX)∫0∞ectcyΓ(k)(cθ)k1yk−1e−y/cθdy∫0∞etzΓ(k)(cθ)k1zk−1e−z/cθdz(1−cθ)−k
Therefore, Y∼Γ(k,cθ).
■
[b]
Shown by mathematical induction.
■
[c]
Shown by the moment generating function.
■
[d]
Shown by the moment generating function.
■
Code
Here is a Julia code that displays the probability density function of the gamma distribution as an animated gif.
@time using LaTeXStrings
@time using Distributions
@time using Plots
cd(@__DIR__)
x = 0:0.1:20
Θ = collect(0.1:0.1:10.0); append!(Θ, reverse(Θ))
animation = @animate for θ ∈ Θ
plot(x, pdf.(Gamma(1, θ), x),
color = :black,
label = "r = 1, θ = $(rpad(θ, 4, '0'))", size = (400,300))
xlims!(0,20); ylims!(0,0.5); title!(L"\mathrm{pmf\,of\,} \Gamma (1, \theta)")
end
gif(animation, "pdf1.gif")
animation = @animate for θ ∈ Θ
plot(x, pdf.(Gamma(2, θ), x),
color = :black,
label = "r = 2, θ = $(rpad(θ, 4, '0'))", size = (400,300))
xlims!(0,20); ylims!(0,0.5); title!(L"\mathrm{pmf\,of\,} \Gamma (2, \theta)")
end
gif(animation, "pdf2.gif")
animation = @animate for θ ∈ Θ
plot(x, pdf.(Gamma(4, θ), x),
color = :black,
label = "r = 4, θ = $(rpad(θ, 4, '0'))", size = (400,300))
xlims!(0,20); ylims!(0,0.5); title!(L"\mathrm{pmf\,of\,} \Gamma (4, \theta)")
end
gif(animation, "pdf4.gif")