You are on page 1of 3

8.

Lecture 11 Friday 02/09/01

Homework and Labs. see the logictics section


Please hand in your labs to Johan by next Monday.

Maximum Likelihood Estimation

X1 , X2 , X3 , . . . Xn have joint density denoted


f (x1 , x2 , . . . , xn ) = f (x1 , x2 , . . . , xn |)
Given observed values X1 = x1 , X2 = x2 , . . . , Xn = xn , the likelihood of is the function
lik() = f (x1 , x2 , . . . , xn |)
considered as a function of .
If the distribution is discrete, f will be the frequency distribution function.
In words: lik()=probability of observing the given data as a function of .
Definition:
The maximum likelihood estimate (mle) of is that value of that maximises lik(): it is
the value that makes the observed data the most probable.
If the Xi are iid, then the likelihood simplifies to
lik() =

n
Y

f (xi |)

i=1

Rather than maximising this product which can be quite tedious, we often use the fact
that the logarithm is an increasing function so it will be equivalent to maximise the log
likelihood:
n
l() =

log(f (xi |))

i=1

9.0.1

Poisson Example

x e
x!
For X1 , X2 , . . . , Xn iid Poisson random variables will have a joint frequency function that is
a product of the marginal frequency functions, the log likelihood will thus be:
P (X = x) =

l()

= ni=1 (Xi log logXi !)


P
P
= log ni=1 Xi n ni=1 logXi !
P

We need to find the maximum by finding the derivative:


l0 () =

n
1X
xi n = 0
i=1

which implies that the estimate should be


=X

(as long as we check that the function l is actually concave, which it is).
The mle agrees with the method of moments in this case, so does its sampling distribution.
9.0.2

Normal Example

If X1 , X2 , . . . , Xn are iid N (, 2 ) random variables their density is written:


f (x1 , . . . , xn |, ) =

n
Y
i

1 x 2
1
exp ( [ i
])
2

Regarded as a function of the two parameters, and this is the likelihood:


n
n
1 X
`(, ) = nlog log2 2
(xi )2
2
2 i=1
n
`
1 X
=
(xi )

2 i=1

`
P
= n + 3 ni=1 (xi )2

as the mle for , and


so setting these to zero gives X
2 as the usual.
9.0.3

Gamma Example
f (x|, ) =

1 1 x
x e
()

giving the log-likelihood:


l(x|, ) =

n
X

[log + ( 1)logxi xi log()]

i=1

One ends up with a nonlinear equation in


this cannot be solved in closed form, there
are basically two methods and they are called root-finding methods, they are based on the
calculus theorem that says that when a function is continuous, and changes signs on an
interval, it is zero on that interval.
For this particular problem there already coded in matlab a mle method called gamfit,
that also provides a confidence interval.
For general optimization, the function in Matlab is fmin for one variable, and fmins
you could also look at how to use optimize in Splus.
2

9.1

Maximum Likelihood of Multinomial Cell Probabilities

X1 , X2 , . . . , Xm are counts in cells/ boxes 1 up to m, each box has a different probability


(think of the boxes being bigger or smaller) and we fix the number of balls that fall to
be n:x1 + x2 + + xm = n. The probability of each box is pi , with also a constraint:
p1 + p2 + + pm = 1, this is a case in which the Xi0 s are NOT independent, the joint
probability of a vector x1 , x2 , . . . , xm is called the multinomial ,and has the form:
!

n
n! Y xi
f (x1 , x2 , . . . , xm |p1 , . . . , pm ) = Q
pi =
px1 px1 pxmm
xi !
x 1 , x2 , x m 1 1
Each box taken separately against all the other boxes is a binomial, this is an extension
thereof. (look at page 72)
We study the log-likelihood of this :
l(p1 , p2 , ..., pm ) = logn!

m
X
i=1

logxi ! +

m
X

xi logpi

i=1

However we cant just go ahead and maximise this we have to take the constraint into account
so we have to use the Lagrange multipliers again.
We use
m
L(p1 , p2 , ..., pm , ) = l(p1 , p2 , ..., pm ) + (1

pi )

By posing all the derivatives to be 0, we get the most natural estimate


pi =

xi
n

Maximising log likelihood, with and without constraints, can be an unsolvable problem
in closed form, then we have to use iterative procedures.
I explained about how the parametris bootstrap was often the only way to study the
sampling distribution of the mle.

You might also like