Chap 5
Chap 5
Ismaı̈la Ba
[email protected]
STAT 3100 - Winter 2024
1 / 32
Preambule
Contents
1 Preambule
2 / 32
Preambule
MLE : intuition
Example 1
Suppose we toss an unfair coin. Let p be the probability of getting heads,
that is P(heads) = p and consider the observed sample x = (0, 1, 1, 1)
(0=Tails,1=Heads). For what value of p is the observed sample most likely
to have occurred ?
f (x1 , x2 , x3 , x4 ; p) = (1 − p)p 3
3 / 32
Preambule
0.2
0.0
0.08
0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0
Contents
1 Preambule
5 / 32
The Likelihood Function
Definition 1
Let X1 , . . . , Xn have joint pmf or pdf fX1 ,...,Xn (·; θ) where the parameters
θ = (θ1 , . . . , θm ) have unknown values. Given
X1 = x1 , X2 = x2 , . . . , Xn = xn is observed, the function of θ defined by
6 / 32
Maximum Likelihood Estimation
Contents
1 Preambule
7 / 32
Maximum Likelihood Estimation
Methodology
8 / 32
Maximum Likelihood Estimation
Log-likelihood
It is more convenient to work with the log-likelihood function : that
is
n
X
ln L(θ; x) = ln f (xi ; θ)
i=1
and since x 7→ ln x is increasing
θ̂(X) = argmaxθ∈Θ ln L(θ; X).
Example 2
Now,
n
1X
ln L(β; x) = −n ln β − xi .
β i=1
To maximize this with respect to β, we differentiate to obtain
n
n
d d 1 X n 1 X
ln L(β; x) = −n ln β − xi = − + 2 xi .
dβ dβ β i=1 β β i=1
10 / 32
Maximum Likelihood Estimation
Example 3 continued
Setting this equal to 0 and solving for λ yields λ = x n . The second
derivative is n
d2 1 X
ln L(λ; x) = − 2 xi
dλ2 λ i=1
which is negative when evaluated at λ = x n . The MLE of λ is hence
λ̂ = X n . Since X n is unbiased and V(X n ) = λ/n, we also have that λ̂ is
consistent for λ.
13 / 32
Maximum Likelihood Estimation
Example 4
14 / 32
Maximum Likelihood Estimation
Now, define
n 1/n
d Γ′ (α) Y
ψ(α) := ln Γ(α) = and x̃n = xi
dα Γ(α) i=1
where ψ(·) is called the digamma function and x̃n is the geometric
mean of x1 , . . . , xn .
15 / 32
Maximum Likelihood Estimation
Example 4 continued
Setting the partial derivatives to 0, we obtain the maximum likelihood
equations
xn
β=
α
ln(α) − ψ(α) − ln(x n /x̃n ) = 0.
There is no closed form solution for these equations, but they can be
solved numerically.
16 / 32
Maximum Likelihood Estimation
Order Statistics
Definition : order statistics
The order statistics from a random sample X1 , . . . , Xn are the random
variables X1:n , X2:n , . . . , Xn:n given by
so that with probability 1, −∞ < X1:n < X2:n < . . . < Xn:n < ∞.
Remark
X1:n = min{X1 , . . . , Xn }.
Xn:n = max{X1 , . . . , Xn }.
17 / 32
Maximum Likelihood Estimation
18 / 32
Maximum Likelihood Estimation
n!
g (x3:10 , x7:10 ) = [FX (x3:10 )]2 fX (x3:10 )[FX (x7:10 ) − FX (x3:10 )]3
2!1!3!1!3!
fX (x7:10 )[1 − FX (x7:10 )]3
when x3:10 < x7:10 and 0 otherwise.
19 / 32
Maximum Likelihood Estimation
20 / 32
Maximum Likelihood Estimation
Exercise 1
Consider a random sample X1 , . . . , X20 from a continuous distribution with
CDF F and density f . What is the joint density of X2:20 , X5:20 , and X13:20 ?
21 / 32
Maximum Likelihood Estimation
Example 5
L(β; x) =g (x1:n , . . . , xr :n ; β)
r
n! Y
= f (xi:n ; β) [1 − F (xr :n ; β)]n−r
(n − r )! i=1
r
( )
n! 1 1X
(n − r )xr :n
= exp − xi:n exp −
(n − r )! βr β
i=1
β
r
n! 1 1 X
.
= exp − x i:n + (n − r )xr :n
(n − r )! β β
r
i=1
22 / 32
Maximum Likelihood Estimation
Example 5 continued
Notice that t = T (x1 , . . . , xn ) := ri=1 xi:n + (n − r )xr :n represents the
P
observed total time in service of the n times when the experiment is
terminated (at the time of the r’th failure). The log-likelihood (in terms of
t) is
t
ln L(β; x) = −r ln(β) − + const
β
and its derivative with respect to β
d r t
ln L(β; x) = − + 2 .
dβ β β
Example 5 continued
Thus, the MLE becomes
T
β̂ =
r
with T = T (X1 , . . . , Xn ) := i=1 Xi:n + (n − r )Xr :n .
Pr
Exercise 2
Suppose that X1 , . . . , Xn are iid N(µ, σ2 ) random variables with both µ and
σ2 unknown. Find the MLE’s of µ and σ2 .
24 / 32
Maximum Likelihood Estimation
Example 6
25 / 32
Maximum Likelihood Estimation
26 / 32
Maximum Likelihood Estimation
Exercise 4
Let X1 , . . . , Xn be a random sample from a two parameter exponential
distribution Exp(β, η) with density
1 −(x−η)/β
f (x; η, β) = e 1(η,∞) (x).
β
Find the MLE’s of β and η ; and compare with the method of moments
result from Chapter 4.
Example 7
ακα
f (x; α, κ) = 1(κ,∞) (x).
x α+1
27 / 32
Maximum Likelihood Estimation
Example 7 continued
The log-likelihood function is
n
Y 1
ln L(α, κ; x) =
n ln(α) + nα ln(κ) + ln 1{κ ≤ x ∀i}
α+1 i
i=1 xi
n
X
.
= n ln(α) + nα ln(κ) − (α + 1) ln(xi ) 1{κ ≤ xi ∀i}
i=1
28 / 32
Maximum Likelihood Estimation
Example 7 continued
Differentiating ln L(α, κ; x) with respect to α yields
n
d n X
ln L(α, κ; x) = + n ln(κ) − ln(xi ).
dα α i=1
29 / 32
Maximum Likelihood Estimation
Exercises
Exercise 5
Find the MLE’s when X1 , . . . , Xn is a random sample from the following
distributions :
(a) U(0, θ) where θ > 0 is unknown.
(b) Weibull(1/2, γ) where γ > 0 is unknown.
(c) Binomial(20, p) where p ∈ [0, 1] is unknown.
(d) Geometric(p) where pin(0, 1) is unknown.
(e) Laplace(λ) where λ > 0 is unknown.
30 / 32
Maximum Likelihood Estimation
Exercise 6
Let X1 , . . . , Xn be a random sample from a distribution with density
1 −|x−η|/β
f (x; η, β) = e 1(−∞,∞) (x).
β
Find the MLE’s for β and η. Hint : The value of a that minimizes
i=1 |xi − a| is a = median(x1 , . . . , xn ). What are the method of moments
Pn
estimator ?
31 / 32
Maximum Likelihood Estimation
Example 8
Let X1 , . . . , Xn be a random sample from an Exp(β) distribution. What is
the MLE for estimating p(β) = P(X ≥ 1) = e −1/β ? Since X n is the MLE
for β, we have p(β) d = p(β̂) = e −1/X n .
Example 9
Let X1 , . . . , Xn be a random sample from a Poisson(λ) distribution. What is
the MLE for estimating p(λ) = P(X = 0) = e −λ ? Since X n is the MLE for
λ, we have p(λ) d = p(λ̂) = e −X n .
32 / 32