MLE Weibull
MLE Weibull
Distribution1
λy λ−1
y λ
f (y|θ, λ) = exp − (1)
θλ θ
where: y > 0, θ is the scale parameter and λ is the shape parameter (nuisance parameter).
λyi λ−1
yi λ
f (yi |θ, λ) = exp − (2)
θλ θ
then, their join probability distribution is:
n
Y
f (y1 , . . . , yn |θ, λ) = f (yi |θ, λ)
i=1
n
λyi λ−1
Y yi λ
= exp − (3)
i=1
θλ θ
1
To maximize the log-likelihood function (5), requires the derivative with respect to θ. The resulted
function is called the Score function, denoted by U (θ|y1 , . . . , yn , λ).
∂` (θ|y1 , . . . , yn , λ)
U (θ|y1 , . . . , yn , λ) =
∂θ
n
λ λyi λ
X
= − + λ+1
i=1
θ θ
n
λn λ X λ
= − + λ+1 yi (7)
θ θ i=1
U (θ∗ ) = 0 (9)
The equation (9), generally, is a nonlinear equation, that can be aproximate by Taylor Series:
Then, with the Newton-Raphson method: starting with an initial guess θ(1) successive approxima-
tions are obtained using (13), until the iterative process converges.
(t+1) (t) U θ(t)
θ = θ − 0 (t) (13)
U (θ )
In order to example the use of Newton-Rapshon method, we use the data of lifetimes (times to
failure in hours) of Kevlar epoxy strand pressure vessels at 70% stress level2 .
2
This data was taken from Dobson, A. Barnett, A. (2018) An Introduction to Generalized Linear Models. Texts
in Statistical Science. Chapman Hall/CRC.
2
# load data
Y <- as.matrix(read.delim(file = "data.txt", header = FALSE))
We load the code developed into our R function MLE_NR_Weibull, stored in the R object with the
same name.
The function MLE_NR_Weibull takes the sample mean θ = ȳ as a first guess for the iterative process
and, besides some other default parameters that can be modified such as λ = 2, only needs the data
vector Y.
where, a (y) = y λ , b (θ) = −θ−λ , c (θ) = λ log θ − log λ, φ = 1, and d (y, φ) = (λ − 1) log y.
Then, since the Weibull distribution belongs to the exponential family, it can be show that the
variance of U , denoted by J , is:
J = Var {U } = −E {U 0 } (16)
where:
c0 (θ)
0 1 00
E {U } = − b (θ) 0 − c00 (θ) (17)
φ b (θ)
3
For MLE, it is common to approximate U 0 by its expected value E {U 0 }. In this case:
J = −E {U 0 }
= E {−U 0 }
( n )
X
= E − Ui0
i=1
n
X
= −E {Ui0 }
i=1
n
c0 (θ)
X 1 00 00
= − b (θ) 0 − c (θ) (18)
i=1
φ b (θ)
b0 (θ) = λθ−(λ+1)
b00 (θ) = −λ (λ + 1) θ−(λ+2)
c0 (θ) = λθ−1
c00 (θ) = −λθ−2
1
= 1
φ
Then, replacing them into (18):
n −1
−(λ+2) λθ
X
−2
J = − −λ (λ + 1) θ + λθ
i=1
λθ−(λ+1)
n
X λ2
=
θ2
i=1
2
λ
= n (19)
θ
Finally:
2
0 λ
J = −E {U } = n
θ
2
λ
−J = E {U 0 } = n (20)
θ
Then, approximating U 0 by its expected value E {U 0 }, the equation (13) results into:
(t)
U θ
θ(t+1) = θ(t) + (21)
J (θ(t) )
In order to example the use of Fisher-Scoring method, we use the same data used in the Newton-
Rapshon method. We load the code developed into our R function MLE_FS_Weibull, stored in the R
object with the same name.
4
# load the function to solve by Fisher-Scoring
load("MLE_FS_Weibull.RData")
The function MLE_FS_Weibull takes the sample mean θ = ȳ as a first guess for the iterative process
and besides some other default parameters that can be modified such as λ = 2, only needs the data
vector Y.
In summary, the same estimate for the MLE is achieved by both approaches: the Newton-Raphson
and the Fisher-Scoring method.
Naive Approach
The main idea behind the Maximum Likelihood (ML) method is to choose those estimates for the
unknown parameters that maximize the join probability of our observed data (our sample). Keeping in
mind this idea, if we want to get the MLE and avoiding to implement a numerical solution, a naive
approach is to set a large range of possible values for unknown parameters, evaluate the log-likelihood
function (also, the likelihood function) at each point and the point for which the log-likelihood function
(also, the likelihood function) reaches its maximum value, will be our MLE looking for.
We set a set of values por the parameter, from θ̂ = 4000 to θ̂ = 13.000, spaced by 1; and evaluate
(4) and (5) at each point from the set of values.
5
Then, the plot of likelihood function evaluated at each point:
1.5e−209
1.0e−209
Likelihood
5.0e−210
0.0e+00
parameter
The point for which the likelihood function is maximum, is our MLE from a naive approach:
−500
Log−Likelihood
−550
−600
parameter
6
The point for which the log-likelihood function is maximum, which is the same point at the likelihood
function reaches its maximum value, is our MLE from a naive approach:
As we can see, using this naive approach, we reach a value that is close enough to that which is
reached using the numerical solution: the Newton-Raphson and the Fisher-Scoring method.