Note for Gamma Distribution

Motivation for Gamma Function

We all know how to compute the factorial of integer. BUT what is the factorial of 1/2?

In other words, how to interpolate the factorial function?

img

The gamma function can be seen as a solution to the following interpolation problem:

“Find a smooth curve that connects the points (x, y) given by y = (x − 1)! at the positive integer values for x.”

More details, check the wiki page.

Definition of Gamma Function

Definition 1 (Gamma Function) Γ(z)=0xz1exdx,  zR+

For the the Gamma function, it is enough to know the following properties for now.

Lemma 1 Γ(z+1)=zΓ(z),  zR+Γ(n)=(n1)!,  n=1,2,3,...

Easy to prove using integration by parts.

Now, what is Γ(12)?

Γ(12)=0x1/2exdx=?

Recall that, 0ex2=12π, let u=x2 and will get the result Γ(12)=π.

Gamma Distribution

From the Gamma function, it is pretty natural to get Gamma pdf. JUST normalizing!

Clearly, 1=0xr1exΓ(r)dx=0fX(x)dx,   X:=Gamma(r,1)

What is the pdf for the general Gamma(r,λ) ? Let

Y=Xλ, YGamma(r,λ) fY(y)=fX(x)dxdy

We’ll get

f(y;r,λ)=λryr1eλyΓ(r)

Here, r is called the shape parameter and λ is called the rate parameter.

How to remember the Gamma pdf?

That’s my trick: exponential density times the power rise to (shape-1), then divided by normalizer.

  • Exponential density (very familiar): λeλx

  • power rise to (shape-1): (λx)r1

  • normalizing constant (using shape): Γ(r)

f(x;r,λ)=exp densitypowershape-1normalizer=λeλx(λx)r1Γ(r)=λrxr1eλxΓ(r)


Another way to remember is this:

  1. Exponential key part: eλx

  2. Add Power part: λxeλx

    • multiply the power part in exponential
    • rate rises to shape
    • variable rises to shape-1

    λrxr1eλx

  3. Add Normalizing part: λrxr1eλxΓ(r)

Gamma & Exponential Connection

Let’s recall the Poisson Process, Nt=number of arrials up to time tPois(λt) The number of arrivals in the disjoint intervals are independent.

Let T1 be the time of 1st arrival, P(T1>t)=P(Nt=0)=eλt T1Exp(λ) Now, let Tn be the time of nth arrival, that is, Tn=i=1nXi , where XiiidExp(λ)

What is the pdf of Tn? Answer is Gamma!

Proposition 1 Gamma is the sum of iid Exponentials.

Proof:

Since MX(t)=λλt, where t<λ,

Mi=1nXi(t)=(MX(t))n=(λλt)n

It is enough to show the MGF of Gamma equals the above value.

Let YGamma(n,λ),

MY(t)=E(ety)=0ety1Γ(n)λneλyyn1dy=λnΓ(n)0e(λt)yyn1dy, let u=(λt)y=λnΓ(n)(1λt)n0euun1du=λnΓ(n)(1λt)nΓ(n)=(λλt)n

Proved!

Remark. The Exponential is the continous analog of the Geometric. Similarly, the Gamma is the continous analog of the Negative Binomial.

Chen Xing
Chen Xing
Founder & Data Scientist

Enjoy Life & Enjoy Work!

Related