Books Probability and Statistical Inference

The Exponential, Gamma, and Chi-Squared Distributions

Consider a Poisson process with mean rate λ>0\lambda >0. Let 𝑊𝑊 denote the waiting time, which is also a random quantity, until the first event occurs. We want to find the distribution of 𝑊𝑊. Consider the probability P(𝑊≤𝑤)ℙ(𝑊\leq 𝑤) where 𝑤≥0𝑤\geq 0. (If 𝑤<0𝑤<0, then it is clear that P(𝑊≤𝑤)=0ℙ(𝑊\leq 𝑤)=0.) We have

P(𝑊≤𝑤)=1−P(𝑊>𝑤)=1−P({no occurrences in the interval [0,𝑤]}).ℙ(𝑊\leq 𝑤)=1-ℙ(𝑊>𝑤)=1-ℙ(\{\text{no occurrences in the interval}\, [0,𝑤]\}).

Let 𝑌𝑌 denote the number of occurrences in the interval [0,𝑤][0,𝑤]. By the given condition, we know that 𝑌∼Pois⁡(λ𝑤)𝑌∼\operatorname{Pois}(\lambda 𝑤). Then the probability of no occurrences in the interval [0,𝑤][0,𝑤] is given by the probability mass function of the Poisson distribution evaluated at 0,

P({no occurrences in the interval [0,𝑤]})=𝑓𝑌(0)=𝑒−λ𝑤.ℙ(\{\text{no occurrences in the interval}\, [0,𝑤]\})={𝑓}_{𝑌}(0)={𝑒}^{-\lambda 𝑤}.

Therefore, we have

P(𝑊≤𝑤)=1−𝑒−λ𝑤.ℙ(𝑊\leq 𝑤)=1-{𝑒}^{-\lambda 𝑤}.

This is the CDF of 𝑊𝑊, that is,

𝐹(𝑤)={0,𝑤<01−𝑒−λ𝑤,𝑤≥0𝐹(𝑤)=\begin{cases}0, & 𝑤<0 \\ 1-{𝑒}^{-\lambda 𝑤}, & 𝑤\geq 0\end{cases}

When 𝑤>0𝑤>0, the PDF of 𝑊𝑊 is

𝑓(𝑤)=𝐹′(𝑤)=λ𝑒−λ𝑤.𝑓(𝑤)={𝐹}^{\prime }(𝑤)=\lambda {𝑒}^{-\lambda 𝑤}.

We often denote λ=1/θ\lambda =1/\theta and say that the random variable 𝑋𝑋 has an exponential distribution if its PDF is given by

𝑓(𝑥)=1θ𝑒−𝑥/θ,𝑥≥0.𝑓(𝑥)=\frac{1}{\theta }{𝑒}^{-𝑥/\theta },\quad 𝑥\geq 0.

where the parameter θ>0\theta >0. In fact, θ\theta is precisely the mean of the distribution. To see this, we first find its MGF 𝑀(𝑡)𝑀(𝑡).

We have

𝑀(𝑡)=E[𝑒𝑡𝑋]=∫0∞𝑒𝑡𝑥⋅1θ𝑒−𝑥/θ d𝑥=1θ∫0∞𝑒(𝑡−1/θ)𝑥 d𝑥.𝑀(𝑡)=\mathbb{E}[{𝑒}^{𝑡𝑋}]={\int }_{0}^{\infty }{𝑒}^{𝑡𝑥}\cdot \frac{1}{\theta }{𝑒}^{-𝑥/\theta }\, \mathrm{d}𝑥=\frac{1}{\theta }{\int }_{0}^{\infty }{𝑒}^{(𝑡-1/\theta )𝑥}\, \mathrm{d}𝑥.

In order for the integral to converge, we require that 𝑡<1θ𝑡<\frac{1}{\theta }. Then, we have

𝑀(𝑡)=11−θ𝑡,−1θ<𝑡<1θ.𝑀(𝑡)=\frac{1}{1-\theta 𝑡},\quad -\frac{1}{\theta }<𝑡<\frac{1}{\theta }.

The first and second derivatives of 𝑀(𝑡)𝑀(𝑡) are given by

𝑀′(𝑡)=θ(1−θ𝑡)2,𝑀′′(𝑡)=2θ2(1−θ𝑡)3.{𝑀}^{\prime }(𝑡)=\frac{\theta }{{(1-\theta 𝑡)}^{2}},{𝑀}^{\prime\prime }(𝑡)=2\frac{{\theta }^{2}}{{(1-\theta 𝑡)}^{3}}.

Evaluating at 𝑡=0𝑡=0, we get

𝑀′(0)=θand𝑀′′(0)=2θ2.{𝑀}^{\prime }(0)=\theta \quad \text{and}\quad {𝑀}^{\prime\prime }(0)=2{\theta }^{2}.

Therefore, the mean and variance of the exponential distribution are

μ=𝑀′(0)=θσ2=𝑀′′(0)−[𝑀′(0)]2=2θ2−θ2=θ2.\begin{aligned}\mu & ={𝑀}^{\prime }(0)=\theta \\ {\sigma }^{2} & ={𝑀}^{\prime\prime }(0)-{[{𝑀}^{\prime }(0)]}^{2}=2{\theta }^{2}-{\theta }^{2}={\theta }^{2}.\end{aligned}

So, if λ\lambda is the mean number of occurrences in a unit interval, then θ=1/λ\theta =1/\lambda is the mean waiting time until the first occurrence, which agrees with our intuition.

For the exponential random variable 𝑋𝑋 with mean θ\theta , its CDF is

𝐹(𝑥)={0,𝑥<01−𝑒−𝑥/θ,𝑥≥0𝐹(𝑥)=\begin{cases}0, & 𝑥<0 \\ 1-{𝑒}^{-𝑥/\theta }, & 𝑥\geq 0\end{cases}

Its median 𝑚𝑚 is the solution to 𝐹(𝑚)=1/2𝐹(𝑚)=1/2, that is,

𝑚=θln⁡2,𝑚=\theta \ln 2,

which is slightly less than the mean θ\theta .

The PDF and CDF of the exponential distribution are shown in Figure 3.1.

Figure 3.1 The PDF 𝑓(𝑥)𝑓(𝑥) and CDF 𝐹(𝑥)𝐹(𝑥) of an exponential distribution with mean θ=5\theta =5. Dashed vertical lines indicate the median 𝑚=θln⁡2𝑚=\theta \ln 2 and the mean θ\theta .

We can see that the PDF of an exponential distribution is monotonically decreasing. To show this, we need to calcuate the derivative of the PDF and show that it is negative. We have

𝑓′(𝑥)=−1θ2𝑒−𝑥/θ,𝑥≥0.{𝑓}^{\prime }(𝑥)=-\frac{1}{{\theta }^{2}}{𝑒}^{-𝑥/\theta },\quad 𝑥\geq 0.

Thereofre, indeed 𝑓′(𝑥)<0{𝑓}^{\prime }(𝑥)<0 for all 𝑥≥0𝑥\geq 0. An immediate consequence is that the mode of the exponential distribution is 𝑥=0𝑥=0, at which the maximum value of the PDF is 𝑓(0)=1/θ𝑓(0)=1/\theta .

Apart from the probability P(𝑋≤𝑥)ℙ(𝑋\leq 𝑥) for an exponential random variable 𝑋𝑋 with mean θ\theta that is given by the CDF, it is also useful to note that

P(𝑋>𝑥)=1−𝐹(𝑥)=𝑒−𝑥/θwhen 𝑥>0.ℙ(𝑋>𝑥)=1-𝐹(𝑥)={𝑒}^{-𝑥/\theta }\quad \text{when}\, 𝑥>0.
Exercise 3.1
Customers arrive at a store according to a Poisson process with mean rate of 2020 per hour. What is the probability that the shopkeeper will have to wait more than 55 minutes for the first customer?
Solution

Let 𝑋𝑋 be the waiting time for the first customer and let λ=20\lambda =20. Therefore, 𝑋𝑋 follows an exponential distribution with mean θ=1λ=120\theta =\frac{1}{\lambda }=\frac{1}{20}. We want to find P(𝑋>560)ℙ\left(𝑋>\frac{5}{60}\right). We have

P(𝑋>560)=𝑒−5/601/20=𝑒−5/3≈0.1889.ℙ\left(𝑋>\frac{5}{60}\right)={𝑒}^{-\frac{5/60}{1/20}}={𝑒}^{-5/3}\approx 0.1889.

Make sure to use consistent units of time for the rate and the waiting time: here λ\lambda is per hour, so express 55 minutes as 560\frac{5}{60} hour before substituting into the formula.

Exercise 3.2

Let 𝑋𝑋 be an exponential random variable with mean θ\theta . Show that

P[𝑋>𝑥+𝑦∣𝑋>𝑥]=P(𝑋>𝑦).ℙ[𝑋>𝑥+𝑦|𝑋>𝑥]=ℙ(𝑋>𝑦).
Proof

We have

P[𝑋>𝑥+𝑦∣𝑋>𝑥]=P({𝑋>𝑥+𝑦}∩{𝑋>𝑥})P(𝑋>𝑥)=P(𝑋>𝑥+𝑦)P(𝑋>𝑥)=𝑒−(𝑥+𝑦)/θ𝑒−𝑥/θ=𝑒−𝑦/θ=P(𝑋>𝑦).\begin{aligned}ℙ[𝑋>𝑥+𝑦|𝑋>𝑥] & =\frac{ℙ(\{𝑋>𝑥+𝑦\}\cap \{𝑋>𝑥\})}{ℙ(𝑋>𝑥)} \\ & =\frac{ℙ(𝑋>𝑥+𝑦)}{ℙ(𝑋>𝑥)} \\ & =\frac{{𝑒}^{-(𝑥+𝑦)/\theta }}{{𝑒}^{-𝑥/\theta }} \\ & ={𝑒}^{-𝑦/\theta } \\ & =ℙ(𝑋>𝑦).\end{aligned}

There is an interesting interpretation of the result in Exercise 3.2. Suppose a certain type of electronic component has a lifetime that is exponentially distributed with mean life of 500500 hours. If the component has been in operation for 300300 hours, the conditional probability that it will last for another 600600 hours is

P[𝑋>300+600∣𝑋>300]=P(𝑋>600)ℙ[𝑋>300+600|𝑋>300]=ℙ(𝑋>600)

due to the result from Exercise 3.2. Equivalently, the probability that this component survives another 600600 hours equals the probability that a new component survives its first 600600 hours: past operation does not make failure in the next interval more or less likely under this model. This is against our intuition, which means that the exponential distribution is probably not a good model for the lifetime of this component.

In a Poisson process with mean rate λ\lambda , we have seen the waiting time of the first occurrence has an exponential distribution. We now generalize this by considering the waiting time 𝑊𝑊 of the α\alpha -th occurrence. The CDF of 𝑊𝑊 is given by

𝐹(𝑤)=P(𝑊≤𝑤)=1−P(𝑊>𝑤).𝐹(𝑤)=ℙ(𝑊\leq 𝑤)=1-ℙ(𝑊>𝑤).

The event {𝑊>𝑤}\{𝑊>𝑤\} means that within the interval [0,𝑤][0,𝑤], there are less than α\alpha occurrences. Thereofore,

P(𝑊>𝑤)=P(𝑌<α)=∑𝑘=0α−1𝑒−λ𝑤(λ𝑤)𝑘𝑘!.ℙ(𝑊>𝑤)=ℙ(𝑌<\alpha )=\sum _{𝑘=0}^{\alpha -1}{𝑒}^{-\lambda 𝑤}\frac{{(\lambda 𝑤)}^{𝑘}}{𝑘!}.
(3.1)

where 𝑌𝑌 denotes the number of occurrences in the interval [0,𝑤][0,𝑤] which follows a Poisson distribution with mean λ𝑤\lambda 𝑤. Hence, 𝐹(𝑤)𝐹(𝑤) is given by

𝐹(𝑤)={1−𝑒−λ𝑤∑𝑘=0α−1(λ𝑤)𝑘𝑘!,𝑤≥00,𝑤<0𝐹(𝑤)=\begin{cases}1-{𝑒}^{-\lambda 𝑤}{\sum }_{𝑘=0}^{\alpha -1}\frac{{(\lambda 𝑤)}^{𝑘}}{𝑘!}, & 𝑤\geq 0 \\ 0, & 𝑤<0\end{cases}

When 𝑤>0𝑤>0, taking the derivative of 𝐹(𝑤)𝐹(𝑤) with respect to 𝑤𝑤, we get the PDF of 𝑊𝑊 as

𝑓(𝑤)=𝐹′(𝑤)=λα𝑤α−1𝑒−λ𝑤(α−1)!,𝑤>0.𝑓(𝑤)={𝐹}^{\prime }(𝑤)=\frac{{\lambda }^{\alpha }{𝑤}^{\alpha -1}{𝑒}^{-\lambda 𝑤}}{(\alpha -1)!},\quad 𝑤>0.
(3.2)

A PDF of this form is said to be one of the gamma type, and the random variable 𝑊𝑊 is said to have a gamma distribution . For a general gamma distribution, the parameter α\alpha is not necessarily a positive integer like we assumed in the above derivation. But to make this generalization, we need to introduce the concept of the gamma function for which this discussion is named after. The gamma function is defined as

Γ(𝑡)=∫0∞𝑦𝑡−1𝑒−𝑦 d𝑦,𝑡>0.\Gamma (𝑡)={\int }_{0}^{\infty }{𝑦}^{𝑡-1}{𝑒}^{-𝑦}\, \mathrm{d}𝑦,\quad 𝑡>0.

If 𝑡>1𝑡>1, applying integration by parts, we have

Γ(𝑡)=∫0∞𝑦𝑡−1𝑒−𝑦 d𝑦=[−𝑦𝑡−1𝑒−𝑦]0∞+(𝑡−1)∫0∞𝑦𝑡−2𝑒−𝑦 d𝑦.\Gamma (𝑡)={\int }_{0}^{\infty }{𝑦}^{𝑡-1}{𝑒}^{-𝑦}\, \mathrm{d}𝑦={[-{𝑦}^{𝑡-1}{𝑒}^{-𝑦}]}_{0}^{\infty }+(𝑡-1){\int }_{0}^{\infty }{𝑦}^{𝑡-2}{𝑒}^{-𝑦}\, \mathrm{d}𝑦.

The first term is 0 because 𝑦𝑡−1𝑒−𝑦↦0{𝑦}^{𝑡-1}{𝑒}^{-𝑦}\mapsto 0 as 𝑦↦∞𝑦\mapsto \infty . The integral in the second term is Γ(𝑡−1)\Gamma (𝑡-1) by definition. Therefore, we have

Γ(𝑡)=(𝑡−1)Γ(𝑡−1),𝑡>1.\Gamma (𝑡)=(𝑡-1)\Gamma (𝑡-1),\quad 𝑡>1.
(3.3)

For a positive integer 𝑛𝑛, by applying (3.3) repeatedly, we get

Γ(𝑛)=(𝑛−1)Γ(𝑛−1)=(𝑛−1)(𝑛−2)Γ(𝑛−2)=⋯=(𝑛−1)(𝑛−2)⋯(1)Γ(1).\Gamma (𝑛)=(𝑛-1)\Gamma (𝑛-1)=(𝑛-1)(𝑛-2)\Gamma (𝑛-2)=\cdots =(𝑛-1)(𝑛-2)\cdots (1)\Gamma (1).

The value of Γ(1)\Gamma (1) is easily calculated as

Γ(1)=∫0∞𝑦1−1𝑒−𝑦 d𝑦=∫0∞𝑒−𝑦 d𝑦=[−𝑒−𝑦]0∞=1.\Gamma (1)={\int }_{0}^{\infty }{𝑦}^{1-1}{𝑒}^{-𝑦}\, \mathrm{d}𝑦={\int }_{0}^{\infty }{𝑒}^{-𝑦}\, \mathrm{d}𝑦={[-{𝑒}^{-𝑦}]}_{0}^{\infty }=1.

Therefore, we have

Γ(𝑛)=(𝑛−1)!,𝑛∈Z+.\Gamma (𝑛)=(𝑛-1)!,\quad 𝑛\in {\mathbb{Z}}^{+}.

This is the same as the definition of the factorial function for positive integers.

By expressing the denominator of the PDF (3.2) as (α−1)!=Γ(α)(\alpha -1)!=\Gamma (\alpha ) using gamma function, we get

𝑓(𝑤)=λα𝑤α−1𝑒−λ𝑤Γ(α),𝑤>0.𝑓(𝑤)=\frac{{\lambda }^{\alpha }{𝑤}^{\alpha -1}{𝑒}^{-\lambda 𝑤}}{\Gamma (\alpha )},\quad 𝑤>0.
(3.4)

We see that (3.4) is valid for any positive real number α\alpha . Similar to exponential distributions, we usually denote λ=1θ\lambda =\frac{1}{\theta }.

Let us now formally define the gamma distribution and find its characteristics. A random variable 𝑋𝑋 is said to have a gamma distribution with parameters α>0\alpha >0 and θ>0\theta >0 if its PDF is given by

𝑓(𝑥)=1Γ(α)θα𝑥α−1𝑒−𝑥/θ,𝑥>0.𝑓(𝑥)=\frac{1}{\Gamma (\alpha ){\theta }^{\alpha }}{𝑥}^{\alpha -1}{𝑒}^{-𝑥/\theta },\quad 𝑥>0.

We need to verify that the integral of the PDF on its support is indeed 11. We have

∫0∞1Γ(α)θα𝑥α−1𝑒−𝑥/θ d𝑥=1Γ(α)θα∫0∞𝑥α−1𝑒−𝑥/θ d𝑥.{\int }_{0}^{\infty }\frac{1}{\Gamma (\alpha ){\theta }^{\alpha }}{𝑥}^{\alpha -1}{𝑒}^{-𝑥/\theta }\, \mathrm{d}𝑥=\frac{1}{\Gamma (\alpha ){\theta }^{\alpha }}{\int }_{0}^{\infty }{𝑥}^{\alpha -1}{𝑒}^{-𝑥/\theta }\, \mathrm{d}𝑥.

Applying change of variable 𝑦=𝑥/θ𝑦=𝑥/\theta , we get

∫0∞𝑥α−1𝑒−𝑥/θ d𝑥=θα∫0∞𝑦α−1𝑒−𝑦 d𝑦=θαΓ(α).{\int }_{0}^{\infty }{𝑥}^{\alpha -1}{𝑒}^{-𝑥/\theta }\, \mathrm{d}𝑥={\theta }^{\alpha }{\int }_{0}^{\infty }{𝑦}^{\alpha -1}{𝑒}^{-𝑦}\, \mathrm{d}𝑦={\theta }^{\alpha }\Gamma (\alpha ).

This shows that the integral of the PDF on its support is indeed 11.

The MGF of the gamma distribution is given by

𝑀(𝑡)=E[𝑒𝑡𝑋]=∫0∞𝑒𝑡𝑥⋅1Γ(α)θα𝑥α−1𝑒−𝑥/θ d𝑥=1Γ(α)θα∫0∞𝑥α−1𝑒−(1θ−𝑡)𝑥 d𝑥.\begin{aligned}𝑀(𝑡) & =\mathbb{E}[{𝑒}^{𝑡𝑋}] \\ & ={\int }_{0}^{\infty }{𝑒}^{𝑡𝑥}\cdot \frac{1}{\Gamma (\alpha ){\theta }^{\alpha }}{𝑥}^{\alpha -1}{𝑒}^{-𝑥/\theta }\, \mathrm{d}𝑥 \\ & =\frac{1}{\Gamma (\alpha ){\theta }^{\alpha }}{\int }_{0}^{\infty }{𝑥}^{\alpha -1}{𝑒}^{-\left(\frac{1}{\theta }-𝑡\right)𝑥}\, \mathrm{d}𝑥.\end{aligned}

Enforcing the condition that 𝑡<1θ𝑡<\frac{1}{\theta } and applying change of variable 𝑦=(1θ−𝑡)𝑥𝑦=\left(\frac{1}{\theta }-𝑡\right)𝑥, we obtain

∫0∞𝑥α−1𝑒−(1θ−𝑡)𝑥 d𝑥=∫0∞(1θ−𝑡)−α𝑦α−1𝑒−𝑦 d𝑦=θα(1−θ𝑡)αΓ(α).{\int }_{0}^{\infty }{𝑥}^{\alpha -1}{𝑒}^{-\left(\frac{1}{\theta }-𝑡\right)𝑥}\, \mathrm{d}𝑥={\int }_{0}^{\infty }{\left(\frac{1}{\theta }-𝑡\right)}^{-\alpha }{𝑦}^{\alpha -1}{𝑒}^{-𝑦}\, \mathrm{d}𝑦=\frac{{\theta }^{\alpha }}{{(1-\theta 𝑡)}^{\alpha }}\Gamma (\alpha ).

Therefore, we have

𝑀(𝑡)=1(1−θ𝑡)α,𝑡<1θ.𝑀(𝑡)=\frac{1}{{(1-\theta 𝑡)}^{\alpha }},\quad 𝑡<\frac{1}{\theta }.

The first and second derivatives of 𝑀(𝑡)𝑀(𝑡) are given by

𝑀′(𝑡)=αθ(1−θ𝑡)α+1and𝑀′′(𝑡)=α(α+1)θ2(1−θ𝑡)α+2.{𝑀}^{\prime }(𝑡)=\frac{\alpha \theta }{{(1-\theta 𝑡)}^{\alpha +1}}\quad \text{and}\quad {𝑀}^{\prime\prime }(𝑡)=\frac{\alpha (\alpha +1){\theta }^{2}}{{(1-\theta 𝑡)}^{\alpha +2}}.

Evaluating at 𝑡=0𝑡=0, we get

𝑀′(0)=αθand𝑀′′(0)=α2θ2+αθ2.{𝑀}^{\prime }(0)=\alpha \theta \quad \text{and}\quad {𝑀}^{\prime\prime }(0)={\alpha }^{2}{\theta }^{2}+\alpha {\theta }^{2}.

Hence, the mean and variance of the gamma distribution are

μ=αθandσ2=αθ2.\mu =\alpha \theta \quad \text{and}\quad {\sigma }^{2}=\alpha {\theta }^{2}.
Exercise 3.3
Let’s revisit the problem of the shopkeeper waiting for customers. Assume now the number of customers per hour arriving follows a Poisson process with mean 3030. What is the probability that the shopkeeper will have to wait more than 55 minutes before both of the first two customers arrive?
Solution

Let minute be our time unit. The number of customer arrivals in a minute follows a Poisson distribution with mean λ=0.5\lambda =0.5. Then, the waiting time 𝑋𝑋 before the first 22 arrivals follows a gamma distribution with parameters α=2\alpha =2 and θ=1λ=2\theta =\frac{1}{\lambda }=2. The PDF of 𝑋𝑋 is given by

𝑓(𝑥)=1Γ(2)22𝑥2−1𝑒−𝑥2=14𝑥𝑒−𝑥2,𝑥≥0.𝑓(𝑥)=\frac{1}{\Gamma (2){2}^{2}}{𝑥}^{2-1}{𝑒}^{-\frac{𝑥}{2}}=\frac{1}{4}𝑥{𝑒}^{-\frac{𝑥}{2}},\quad 𝑥\geq 0.

To find P(𝑋>5)ℙ(𝑋>5), we need to evaluate the integral of the PDF from 55 to ∞\infty :

P(𝑋>5)=∫5∞14𝑥𝑒−𝑥2 d𝑥=14∫5∞𝑥𝑒−𝑥2 d𝑥=14([−2𝑥𝑒−𝑥2]5∞+∫5∞2𝑒−𝑥2 d𝑥)=14(10𝑒−5/2+4𝑒−5/2)=72𝑒−5/2≈0.2873.\begin{aligned}ℙ(𝑋>5) & ={\int }_{5}^{\infty }\frac{1}{4}𝑥{𝑒}^{-\frac{𝑥}{2}}\, \mathrm{d}𝑥 \\ & =\frac{1}{4}{\int }_{5}^{\infty }𝑥{𝑒}^{-\frac{𝑥}{2}}\, \mathrm{d}𝑥 \\ & =\frac{1}{4}\left({\left[-2𝑥{𝑒}^{-\frac{𝑥}{2}}\right]}_{5}^{\infty }+{\int }_{5}^{\infty }2{𝑒}^{-\frac{𝑥}{2}}\, \mathrm{d}𝑥\right) \\ & =\frac{1}{4}(10{𝑒}^{-5/2}+4{𝑒}^{-5/2}) \\ & =\frac{7}{2}{𝑒}^{-5/2}\approx 0.2873.\end{aligned}

Alternatively, we can also use the formula (3.1) we have derived earlier to easily find this probability:

P(𝑋>5)=∑𝑘=01𝑒−5λ(5λ)𝑘𝑘!=𝑒−5/2+𝑒−5/2⋅52=72𝑒−5/2.ℙ(𝑋>5)=\sum _{𝑘=0}^{1}{𝑒}^{-5\lambda }\frac{{(5\lambda )}^{𝑘}}{𝑘!}={𝑒}^{-5/2}+{𝑒}^{-5/2}\cdot \frac{5}{2}=\frac{7}{2}{𝑒}^{-5/2}.

To see how the parameters α\alpha and θ\theta affect the shape of the PDF, we plot several gamma densities in Figure 3.2. In each panel, one parameter is held fixed while the other varies. Note that for a fixed θ\theta , the probability moves right as α\alpha increases. The same is true when α\alpha is fixed and θ\theta increases. We have another interesting observation here:

Note
The qualitative behavior changes markedly at α=1\alpha =1: for α<1\alpha <1 the density diverges at 𝑥=0𝑥=0; for α=1\alpha =1 it is positive and finite at the origin; for α>1\alpha >1 it is zero at 𝑥=0𝑥=0 and then rises to a peak.
Figure 3.2 The PDF 𝑓(𝑥)𝑓(𝑥) of gamma distributions with varying shape and scale parameters. (a) θ=2\theta =2 fixed; α\alpha varies. (b) α=2\alpha =2 fixed; θ\theta varies. The red curve in each panel is the gamma PDF with α=2.0\alpha =2.0 and θ=2.0\theta =2.0; it is the same density in both panels and serves as a common reference when comparing the other curves.

To study the geometric behavior of the gamma PDF and to locate its modes, we compute 𝑓′(𝑥){𝑓}^{\prime }(𝑥). We treat α=1\alpha =1 and α≠1\alpha \neq 1 separately. For α=1\alpha =1, the distribution is Exp⁡(θ)\operatorname{Exp}(\theta ), and we have already seen that

𝑓′(𝑥)=−1θ2𝑒−𝑥/θ,𝑥>0.{𝑓}^{\prime }(𝑥)=-\frac{1}{{\theta }^{2}}{𝑒}^{-𝑥/\theta },\quad 𝑥>0.

For α≠1\alpha \neq 1, we have

𝑓′(𝑥)=1Γ(α)θα[(α−1)𝑥α−2𝑒−𝑥/θ−1θ𝑥α−1𝑒−𝑥/θ]=1Γ(α)θα𝑥α−2𝑒−𝑥/θ(α−1−𝑥θ)𝑥>0.\begin{aligned}{𝑓}^{\prime }(𝑥) & =\frac{1}{\Gamma (\alpha ){\theta }^{\alpha }}\left[(\alpha -1){𝑥}^{\alpha -2}{𝑒}^{-𝑥/\theta }-\frac{1}{\theta }{𝑥}^{\alpha -1}{𝑒}^{-𝑥/\theta }\right] \\ & =\frac{1}{\Gamma (\alpha ){\theta }^{\alpha }}{𝑥}^{\alpha -2}{𝑒}^{-𝑥/\theta }\left(\alpha -1-\frac{𝑥}{\theta }\right)\quad 𝑥>0.\end{aligned}

To determine the monotonicity of 𝑓𝑓, we examine the sign of 𝑓′(𝑥){𝑓}^{\prime }(𝑥) and compare with Figure 3.2. We consider α<1\alpha <1, α=1\alpha =1, and α>1\alpha >1 separately. For α<1\alpha <1, we have

α−1−𝑥θ<0∀𝑥>0.\alpha -1-\frac{𝑥}{\theta }<0\quad \forall 𝑥>0.

Hence 𝑓𝑓 is strictly decreasing on (0,∞)(0,\infty ), and from the explicit formula for 𝑓(𝑥)𝑓(𝑥) the PDF diverges as 𝑥→0+𝑥\to {0}^{+}.

For α=1\alpha =1, the distribution is Exp⁡(θ)\operatorname{Exp}(\theta ), which is strictly decreasing; its maximum occurs at 𝑥=0𝑥=0.

For α>1\alpha >1, we have

α−1−𝑥θ{>0,𝑥<(α−1)θ=0,𝑥=(α−1)θ<0,𝑥>(α−1)θ\alpha -1-\frac{𝑥}{\theta }\begin{cases}>0,\quad & 𝑥<(\alpha -1)\theta \\ =0,\quad & 𝑥=(\alpha -1)\theta \\ <0,\quad & 𝑥>(\alpha -1)\theta \end{cases}

Thus 𝑓𝑓 increases on (0,(α−1)θ)(0,(\alpha -1)\theta ), attains its maximum at 𝑥=(α−1)θ𝑥=(\alpha -1)\theta , and decreases on ((α−1)θ,∞)((\alpha -1)\theta ,\infty ).

In summary, the mode of Γ(α,θ)\Gamma (\alpha ,\theta ) is

{(α−1)θ,α>10,α=1undefined,α<1\begin{cases}(\alpha -1)\theta ,\quad & \alpha >1 \\ 0,\quad & \alpha =1 \\ \text{undefined},\quad & \alpha <1\end{cases}

We now consider a special case of the gamma distribution that plays an important role in statistics. Let 𝑋𝑋 have a gamma distribution with parameters α=𝑟2\alpha =\frac{𝑟}{2} and θ=2\theta =2 where 𝑟∈Z+𝑟\in {\mathbb{Z}}^{+}. Then, its PDF is given by

𝑓(𝑥)=1Γ(𝑟/2)2𝑟/2𝑥𝑟/2−1𝑒−𝑥/2,𝑥>0.𝑓(𝑥)=\frac{1}{\Gamma (𝑟/2){2}^{𝑟/2}}{𝑥}^{𝑟/2-1}{𝑒}^{-𝑥/2},\quad 𝑥>0.
(3.5)

We say that 𝑋𝑋 has a chi-squared distribution with 𝑟𝑟 degrees of freedom and write 𝑋∼χ2(𝑟)𝑋∼{\chi }^{2}(𝑟). The practical meaning of degrees of freedom will be explained later. Recall the formulas for the mean, variance, and MGF of the gamma distribution. By substituting α=𝑟/2\alpha =𝑟/2 and θ=2\theta =2, we get associated formulas for the chi-squared distribution:

μ=𝑟/2×2=𝑟andσ2=𝑟/2×22=2𝑟.\mu =𝑟/2\times 2=𝑟\quad \text{and}\quad {\sigma }^{2}=𝑟/2\times {2}^{2}=2𝑟.

And the MGF is given by

𝑀(𝑡)=1(1−2𝑡)𝑟/2,𝑡<12.𝑀(𝑡)=\frac{1}{{(1-2𝑡)}^{𝑟/2}},\quad 𝑡<\frac{1}{2}.
Example 3.1

Recall that

Exp⁡(θ)=Γ(α=1,θ)χ2(𝑟)=Γ(α=𝑟/2,θ=2).\begin{aligned}\operatorname{Exp}(\theta ) & =\Gamma (\alpha =1,\theta ) \\ {\chi }^{2}(𝑟) & =\Gamma (\alpha =𝑟/2,\theta =2).\end{aligned}

Thus, Exp⁡(2)=χ2(2)\operatorname{Exp}(2)={\chi }^{2}(2), that is, the exponential distribution with mean 22 is the same as the chi-squared distribution with 22 degrees of freedom.

Figure 3.3 shows PDFs of chi-squared distributions for several degrees of freedom 𝑟𝑟. Because χ2(𝑟)=Γ(𝑟/2,2){\chi }^{2}(𝑟)=\Gamma (𝑟/2,2), the qualitative shapes match those of the gamma densities in Figure 3.2. For modes, substitute α=𝑟/2\alpha =𝑟/2 and θ=2\theta =2 into the gamma summary above: if 𝑟=1𝑟=1, then α<1\alpha <1 and there is no finite mode in (0,∞)(0,\infty ); if 𝑟=2𝑟=2, then α=1\alpha =1 and the mode is at 𝑥=0𝑥=0 (cf. χ2(2)=Exp⁡(2){\chi }^{2}(2)=\operatorname{Exp}(2)); if 𝑟≥3𝑟\geq 3, then α>1\alpha >1 and the unique mode is 𝑥=(α−1)θ=𝑟−2𝑥=(\alpha -1)\theta =𝑟-2 (for instance, 𝑟=4𝑟=4 gives 𝑥=2𝑥=2). This follows immediately from the gamma discussion; no further derivation is needed.

Figure 3.3 The PDFs of chi-squared distributions χ2(𝑟){\chi }^{2}(𝑟) with varying degrees of freedom 𝑟𝑟.

Tail probabilities and critical values of the chi-squared distribution are central in statistical inference, especially in hypothesis testing. We write χα2(𝑟){\chi }_{\alpha }^{2}(𝑟) for the upper α\alpha critical value of χ2(𝑟){\chi }^{2}(𝑟) with 𝑟𝑟 degrees of freedom, defined by

P(𝑋≥χα2(𝑟))=α.ℙ(𝑋\geq {\chi }_{\alpha }^{2}(𝑟))=\alpha .

Equivalently, χα2(𝑟){\chi }_{\alpha }^{2}(𝑟) is the 100(1−α)100(1-\alpha )-th percentile of χ2(𝑟){\chi }^{2}(𝑟). Accordingly,

P(𝑋≤χ1−α2(𝑟))=α.ℙ(𝑋\leq {\chi }_{1-\alpha }^{2}(𝑟))=\alpha .

Figure 3.4 illustrates the case 𝑟=5𝑟=5 and α=0.1\alpha =0.1: each shaded tail has area α\alpha , with cut points χ1−α=0.92(5){\chi }_{1-\alpha =0.9}^{2}(5) and χα=0.12(5){\chi }_{\alpha =0.1}^{2}(5) on the horizontal axis.

Figure 3.4 The PDF of χ2(5){\chi }^{2}(5) with the lower and upper tails of area α=0.1\alpha =0.1 shaded; dashed vertical segments mark the cut points χ0.92(5){\chi }_{0.9}^{2}(5) and χ0.12(5){\chi }_{0.1}^{2}(5).

Exercises

Exercise 3.4

Let 𝑋𝑋 have a logistic distribution with PDF

𝑓(𝑥)=𝑒−𝑥(1+𝑒−𝑥)2,𝑥∈R.𝑓(𝑥)=\frac{{𝑒}^{-𝑥}}{{(1+{𝑒}^{-𝑥})}^{2}},\quad 𝑥\in \mathbb{R}.

Show that

𝑌=11+𝑒−𝑋∼𝒰(0,1).𝑌=\frac{1}{1+{𝑒}^{-𝑋}}∼𝒰(0,1).
Proof

We will show this by finding the CDF 𝐹𝑌(𝑦){𝐹}_{𝑌}(𝑦) of 𝑌𝑌. By the very expression of 𝑌𝑌 itself, we observe that

0<𝑌<1.0<𝑌<1.

Therefore,

𝐹𝑌(𝑦)=P(𝑌≤𝑦)={0,𝑦≤01,𝑦≥1{𝐹}_{𝑌}(𝑦)=ℙ(𝑌\leq 𝑦)=\begin{cases}0,\quad 𝑦\leq 0 \\ 1,\quad 𝑦\geq 1\end{cases}

In the following, we will consider the case 0<𝑦<10<𝑦<1. We have

𝐹𝑌(𝑦)=P(𝑌≤𝑦)=P(11+𝑒−𝑋≤𝑦)=P(𝑒−𝑋≥1𝑦−1)=P(𝑋≤−ln⁡(1𝑦−1))=𝐹𝑋(−ln⁡(1𝑦−1)).\begin{aligned}{𝐹}_{𝑌}(𝑦)=ℙ(𝑌\leq 𝑦) & =ℙ\left(\frac{1}{1+{𝑒}^{-𝑋}}\leq 𝑦\right) \\ & =ℙ\left({𝑒}^{-𝑋}\geq \frac{1}{𝑦}-1\right) \\ & =ℙ\left(𝑋\leq -\ln \left(\frac{1}{𝑦}-1\right)\right) \\ & ={𝐹}_{𝑋}\left(-\ln \left(\frac{1}{𝑦}-1\right)\right).\end{aligned}

Then this problem turns to evaluating the integral

𝐹𝑋(−ln⁡(1𝑦−1))=∫−∞−ln⁡(1𝑦−1)𝑓(𝑥) d𝑥=∫−∞−ln⁡(1𝑦−1)𝑒−𝑥(1+𝑒−𝑥)2 d𝑥Change variable 𝑡=𝑒−𝑥=∫∞1𝑦−1𝑡(1+𝑡)2(−1𝑡) d𝑡=∫1𝑦−1∞1(1+𝑡)2 d𝑡=[−11+𝑡]1𝑦−1∞=𝑦.\begin{aligned}{𝐹}_{𝑋}\left(-\ln \left(\frac{1}{𝑦}-1\right)\right) & ={\int }_{-\infty }^{-\ln \left(\frac{1}{𝑦}-1\right)}𝑓(𝑥)\, \mathrm{d}𝑥 \\ & ={\int }_{-\infty }^{-\ln \left(\frac{1}{𝑦}-1\right)}\frac{{𝑒}^{-𝑥}}{{(1+{𝑒}^{-𝑥})}^{2}}\, \mathrm{d}𝑥 \\ & \text{Change variable}\, 𝑡={𝑒}^{-𝑥} \\ & ={\int }_{\infty }^{\frac{1}{𝑦}-1}\frac{𝑡}{{(1+𝑡)}^{2}}\left(-\frac{1}{𝑡}\right)\, \mathrm{d}𝑡 \\ & ={\int }_{\frac{1}{𝑦}-1}^{\infty }\frac{1}{{(1+𝑡)}^{2}}\, \mathrm{d}𝑡 \\ & ={\left[-\frac{1}{1+𝑡}\right]}_{\frac{1}{𝑦}-1}^{\infty } \\ & =𝑦.\end{aligned}

In summary, the CDF of 𝑌𝑌 is given by

𝐹𝑌(𝑦)={0,𝑦≤0𝑦,0<𝑦<11,𝑦≥1{𝐹}_{𝑌}(𝑦)=\begin{cases}0,\quad 𝑦\leq 0 \\ 𝑦,\quad 0<𝑦<1 \\ 1,\quad 𝑦\geq 1\end{cases}

This shows that 𝑌𝑌 follows a uniform distribution on (0,1)(0,1).

Exercise 3.5

The initial value of an appliance is $700700 and its dollar value in the future is given by

𝑣(𝑡)=100(23−𝑡−1),0≤𝑡≤3𝑣(𝑡)=100({2}^{3-𝑡}-1),\quad 0\leq 𝑡\leq 3

where 𝑡𝑡 is the time in years since purchase. Thus, after 33 years, 𝑣(𝑡)=0𝑣(𝑡)=0, the appliance is worth nothing as far as the warranty is concerned. If it fails in the first three years, the warranty will pay 𝑣(𝑡)𝑣(𝑡). Assume the failing time 𝑇𝑇 has an exponential distribution with mean of 55 years. Compute the expected value of the warranty payment.

Solution

The expected warranty payment is given by

E[𝑣(𝑇)]=∫03𝑣(𝑡)𝑓(𝑡) d𝑡.\mathbb{E}[𝑣(𝑇)]={\int }_{0}^{3}𝑣(𝑡)𝑓(𝑡)\, \mathrm{d}𝑡.

where

𝑓(𝑡)=15𝑒−𝑡/5,𝑡≥0.𝑓(𝑡)=\frac{1}{5}{𝑒}^{-𝑡/5},\quad 𝑡\geq 0.

Therefore, we need to evaluate the integral

∫03100(23−𝑡−1)15𝑒−𝑡/5 d𝑡=20[8−𝑒−3/5ln⁡2+1/5+5(𝑒−3/5−1)]≈121.7336.{\int }_{0}^{3}100({2}^{3-𝑡}-1)\frac{1}{5}{𝑒}^{-𝑡/5}\, \mathrm{d}𝑡=20\left[\frac{8-{𝑒}^{-3/5}}{\ln 2+1/5}+5({𝑒}^{-3/5}-1)\right]\approx 121.7336.

The warranty payment is expected to be $121.73121.73.