Home page for accesible maths 11.7 Summary

Style control - access keys in brackets

Font (2 3) - + Letter spacing (4 5) - + Word spacing (6 7) - + Line spacing (8 9) - +

Chapter 12 Introduction to Likelihood Inference

12.3 Likelihood Examples: continuous parameters

We now explore examples of likelihood inference for some common models.

TheoremExample 12.3.1 Accident and Emergency

Accident and emergency departments are hard to manage because patients arrive at random (they are unscheduled). Some patients may need to be seen urgently.

Excess staff (doctors and nurses) must be avoided because this wastes NHS money; however, A&E departments also have to adhere to performance targets (e.g. patients dealt with within four hours). So staff levels need to be ‘balanced’ so that there are sufficient staff to meet targets but not too many so that money is not wasted.

A first step in achieving this is to study data on patient arrival times. It is proposed that we model the time between patient arrivals as iid realisations from an Exponential distribution.

Why is this a suitable model?

What assumptions are being made?

Are these assumptions reasonable?

Suppose I stand outside Lancaster Royal Infirmary A&E and record the following inter-arrival times of patients (in minutes):

18.39, 2.70, 5.42, 0.99, 5.42, 31.97, 2.96, 5.28, 8.51, 10.90.

As usual, the first thing we do is look at the data!

arrive<-c(18.39,2.70,5.42,0.99,5.42,31.97,2.96,5.28,8.51,10.90)
stripchart(arrive,pch=4,xlab="inter-arrival time (mins)")

The exponential pdf is given by

f(x)=λexp(-λx),

for x0, λ0. Assuming that the data are iid, the definition of the likelihood function for λ gives us, for general data x1,,xn,

L(λ)=i=1nλexp(-λxi).

Note: we usually drop the ‘|x’ from L(λ|x) whenever possible.

Usually, when we have products and the parameter is continuous, the best way to find the MLE is to find the log-likelihood and differentiate.

So the log-likelihood is

l(λ) =i=1nlog{λexp(-λxi)}
=i=1n{log(λ)-λxi}
=nlog(λ)-λi=1nxi.

Now we differentiate:

λl(λ)=l(λ)=nλ-i=1nxi.

Now solutions to l(λ)=0 are potential MLEs.

  1. 1

    nλ^-i=1nxi=0,

  2. 2

    λ^=ni=1nxi=1x¯.

To ensure this is a maximum we check the second derivative is negative:

2λ2l(λ)=l′′(λ)=-nλ2<0.

So the solution we have found is the MLE, and plugging in our data we find (via 1/mean(arrive))

λ^=0.108.

Now that we have our MLE, we should check that the assumed model seems reasonable. Here, we will use a QQ-plot.

#MLE of lambda (rate)
lam<-1/mean(arrive)
#1/(n+1), 2/(n+1),..., n/(n+1).
quant<-seq(from=1/11,to=10/11,length=10)
#produce QQ-plot
qqplot(qexp(quant,rate=lam),arrive,xlab="Theoretical
quantiles",ylab="Actual")
#add line of equality
abline(0,1)

Given the small dataset, this seems ok – there is no obvious evidence of deviation from the exponential model.

Knowing that the exponential distribution is reasonable, and having an estimate for its rate, is useful to calculate staff scheduling requirements in the A&E.

Extensions of the idea consider flows of patients through the various services (take Math332 Stochastic Processes and/or the STOR-i MRes for more on this).

TheoremExample 12.3.2 Is human body temperature really 98.6 degrees Fahrenheit?

In an article by Mackowiak et al.33Mackowiak P.A., Wasserman, S.S. and Levine, M.M. (1992) A Critical Appraisal of 98.6 Degrees F, the Upper Limit of the Normal Body Temperature and Other Legacies of Carl Reinhold August Wunderlich, the authors measure the body temperatures of a number of individuals to assess whether true mean body temperature is 98.6 degrees Fahrenheit or not. A dataset of 130 individuals is available in the normtemp dataset. The data are assumed to be normally distributed with standard deviation 0.73.

Why is this a suitable model?

What assumptions are being made?

Are these assumptions reasonable?

What do the data look like?

The plot can be produced using

> load("normtemp.Rdata")
> hist(normtemp$temperature)

The histogram of the data is reasonable, but there might be some skew in the data (right tail).

The normal pdf is given by

f(x|μ,σ)=12πσ2exp{-(xi-μ)22σ2},

where in this case, σ is known.

The likelihood is then

L(μ|x1,,xn) =i=1n12πσ2exp{-(xi-μ)22σ2}
=(2πσ2)-n/2exp{-i=1n(xi-μ)22σ2}.

Since the parameter of interest (in this case μ) is continuous, we can differentiate the log-likelihood to find the MLE:

l(μ)=-n2log(2πσ2)-12σ2i=1n(xi-μ)2

and so

l(μ)=-12σ2i=1n(-2)(xi-μ).

For candidate MLEs we set this to zero and solve, i.e.

1σ2i=1nxi-nμ^ =0
i=1nxi-nμ^ =0

and so the MLE is μ^=x¯.

This is also the “obvious” estimate (the sample mean). To check it is indeed an MLE, the second derivative of the log-likelihood is

l′′(μ)=-n<0,

which confirms this is the case.

Using the data, we find μ^=x¯=98.25.

This might indicate evidence for the body temperature being different from the assumed 98.6 degrees Fahrenheit.

We now check the fit:

> temps <-normtemp$temperature   # for shorthand
> mean(temps)
[1] 98.24923
> stdtemp = (temps - mean(temps))/0.73
> qqnorm(stdtemp)
> abline(0,1)   # add "ideal" fit line y = x

The fit looks good – although (as the histogram previously showed) there is possibly some mild right (positive) skew, indicated by the quantile points above the y=x line.

Why might the QQ-plot show the “stepped” behaviour of the points?

TheoremExample 12.3.3

Every day I cycle to Lancaster University, and have to pass through the traffic lights at the crossroads by Booths (heading south down Scotforth Road). I am either stopped or not stopped by the traffic lights. Over a period of a term, I cycle in 50 times. Suppose that the time I arrive at the traffic lights is independent of the traffic light sequence.

On 36 of the 50 days, the lights are on green and I can cycle straight through. Let θ be the probability that the lights are on green. Write down the likelihood and log-likelihood of θ, and hence calculate its MLE.

With the usual iid assumption we see that, if R is the number of times the lights are on green then RBinomial(50,θ). So we have

Pr[R=36]=(5036)θ36(1-θ)14.

We therefore have, for general r and n,

L(θ)=(nr)θr(1-θ)n-r,

and

l(θ)=K+rlog(θ)+(n-r)log(1-θ).

Solutions to l(θ)=0 are potential MLEs:

l(θ)=rθ-n-r1-θ,

and if l(θ^)=0 we have

rθ^=  n-r1-θ^
i.e.  θ^=  rn.

For this to be an MLE it must have negative second derivative.

l′′(θ)=-rθ2-n-r(1-θ)2<0.

In particular we have r=36 and n=50 so θ^=36/50 is the MLE.

Now suppose that over a two week period, on the 14 occasions I get stopped by the traffic lights (they are on red) my waiting times are given by (in seconds)

4.2,6.9,13.7,2.8,19.3,10.4,1.0,19.4,18.6,0.6,4.5,12.9,0.5,16.0.

Assume that the traffic lights remain on red for a fixed amount of time tr, regardless of the traffic conditions.

Given the above data, write down the likelihood of tr, and sketch it. What is the MLE of tr?

We are going to assume that these waiting times are drawn independently from Uniform[0,tr], where tr is the parameter we wish to estimate.

Why is this a suitable model?

What assumptions are being made?

Are these assumptions reasonable?

Constructing the likelihood for this example is slightly different from those we have seen before. The pdf of the Uniform(0,tr) distribution is

f(x)={tr-10xtr0otherwise

The unusual thing here is that the data enters only through the boundary conditions on the pdf. Another way to write the above pdf is

f(x)=tr-1𝟏[0xtr],

where 𝟏 is the indicator function.

For data x1,,xn, the likelihood function is then

L(tr)=i=1ntr-1𝟏[0xitr].

We can write this as

L(tr) =tr-n𝟏[{0x1tr}{0xntr}]
=tr-n𝟏[max(xi)tr].

For our case we have n=14 and max(xi)=19.4, so L(tr)=tr-14𝟏[19.4tr] .

We are next asked to sketch this MLE. In R,

> maxx<-19.4
> #values of t_r to plot
> t<-seq(from=18,to=22,length=1000)
>
> #likelihood function
> uniflik<-function(t){
> t^(-14)*(t>=19.4)
> }
>
> plot(t,uniflik(t),type="l")

From the plot it is clear that t^r=19.4=max(xi), since this is the value that leads to the maximum likelihood. Notice that solving l(tr)=0 would not work in this case, since the likelihood is not differentiable at the MLE.

However, on the feasible range of tr, i.e. max(xi)tr, we have

l(tr)=-nlog(tr),

and so

l(tr)=-n/tr.

Remember that derivatives express the rate of change of a function. Hence since the (log-)likelihood is negative (tr>0 is strictly positive), then the likelihood is decreasing on the feasible range of parameter values.

Since we are trying to maximise the likelihood, this means we should take the minimum over the feasible range as the MLE. The minimum value on the range max(xi)tr is t^r=max(xi)=19.4.

12.4 Likelihood Examples: discrete parameters

One case where differentiation is clearly not the right approach to use for maximisation is when the parameter of interest is discrete.

TheoremExample 12.4.1 Illegal downloads

A computer network comprises of m computers. The probability of one of these computers to store illegally downloaded files is 0.3, independent for each computer. In a particular network it is found that exactly one computer contains illegally downloaded files. Our parameter of interest is m.

What is a suitable model for the data?

What assumptions are being made?

Are these assumptions reasonable?

What is the likelihood of m?

Let XBin(m,0.3) be the number of computers in the network that contains illegally downloaded files. Then Pr(obs|m) is

L(m)=Pr(X=1|m)=(m1)0.31×0.7m-1=0.30.70.7mm.

Note that the possible values m can take are m=1,2,. We can sketch the likelihood for a suitable range of values:

> mrange<-0:20 # value for m=0 will be zero
> plot(mrange,dbinom(1,mrange,0.3),xlab="m",ylab="L(m)")

From the plot, we can see that the MLE for m is m^=3. Alternatively, from the likelihood we have

L(m+1)L(m)=0.31×0.7m(m+1)0.31×0.7m-1m=0.7(m+1)m.

The likelihood is increasing for L(m+1)>L(m), which is equivalent to m<7/3.

To maximize the likelihood, we want the largest (integer) value of m satisfying this constraint, i.e. m=2, hence m^=3.

Relative Likelihood intervals

The ratio between two likelihood values is useful to look at for other reasons.

Definition.

Suppose we have data x1,,xn, that arise from a population with likelihood function L(θ), with MLE θ^. Then the relative likelihood of the parameter θ is

R(θ)=L(θ|𝐱)L(θ^|𝐱).

The relative likelihood quantifies how likely different values of θ are relative to the maximum likelihood estimate.

Using this definition, we can construct relative likelihood intervals which are similar to confidence intervals.

Definition.

A p% relative likelihood interval for θ is defined as the set

{θ|R(θ)p100}.
TheoremExample 12.4.2 Illegal downloads (cont.)

For example a 50% relative likelihood interval for m in our example would be

{m|R(m)0.5} ={m|0.31×0.7m-1m0.31×0.72×30.5}
={m|0.7m-3m1.5}

By plugging in different values of m, we see that the relative likelihood interval is {1,,7}. The values in the interval can be seen in the figure below.

TheoremExample 12.4.3 Sequential sampling with replacement: Smarties colours

Suppose we are interested in estimating m, the number of distinct colours of Smarties.

In order to estimate m, suppose members of the class make a number of draws and record the colour.

Suppose that the data collected (seven draws) were:

purple, blue, brown, blue, brown, purple, brown.

We record whether we had a new colour or repeat:

New, New, New, Repeat, Repeat, Repeat, Repeat.

Let m denote the number of unique colours. Then the likelihood function for m given the above data is:

L(m|𝐱𝟏)=1×m-1m×m-2m×3m×3m×3m×3m.

If in a second experiment, we observed:

New, New, New, Repeat, New, Repeat, New,

then the likelihood would be:

L(m|𝐱𝟐)=1×m-1m×m-2m×3m×m-3m×4m×m-4m.

The MLEs in each case are m^=3 and m^=8.

The plots below show the respective likelihoods.

R code for plotting these likelihoods:

> # experiment 1:
> smartlike<-function(m){
> L<-1*(m-1)*(m-2)*(3)*(3)*(3)*(3)/m^6
> }
> mval<-1:15
> plot(mval,smartlike(mval))
> abline(v=3,col=2)
> which.max(smartlike(mval))
> # Experiment 2:
> # e.g. pink, purple, blue, blue, brown, purple, orange
> smartlike2<-function(m){
> L<-1*(m-1)*(m-2)*(3)*(m-3)*(4)*(m-4)/m^6
> }
> dev.new()
> plot(mval,smartlike2(mval))
> abline(v=8,col=2)
> which.max(smartlike2(mval))
TheoremExample 12.4.4 Brexit opinions

Three randomly selected members of a class of 10 students are canvassed for their opinion on Brexit. Two are in favour of staying in Europe. What can one infer about the overall class opinion?

The parameter in this model is the number of pro-Remain students in the class, m, say. It is discrete, and could take values 0,1,2,,10. The actual true unknown value of m is designated by mtrue.

Now Pr(obs|m) is

Pr(2 in favour from m and 1 against from 10-m).

Now since the likelihood function of m is the probability (or density) of the observed data for given values of m, we have

L(m) =(m2)(10-m1)(103)
=m(m-1)(10-m)240

for m=2,3,,9.

This function is not continuous (because the parameter m is discrete). It can be maximised but not by differentiation.

> #likelihood function
> L<-function(m){
> choose(m,2)*choose(10-m,1)/choose(10,3)
> }
> #values of m to plot
> m<-2:9
> plot(m,L(m),pch=4,col="blue")

The maximum likelihood estimate is m^=7. Note that the points are not joined up in this plot. This is to emphasize the discrete nature of the parameter of interest.

The probability model is an instance of the hypergeometric distribution.

12.5 Summary

{mdframed}

A procedure for modelling and inference:

  1. 1

    Subject-matter question needs answering.

  2. 2

    Data are, or become, available to address this question.

  3. 3

    Look at the data – exploratory analysis.

  4. 4

    Propose a model.

  5. 5

    Check the model fits.

  6. 6

    Use the model to address the question.

  • 1

    The likelihood function is the probability of the observed data for instances of a parameter. Often we use the log-likelihood function as it is easier to work with. The likelihood is a function of an unknown parameter.

  • 2

    The maximum likelihood estimator (MLE) is the value of the parameter that maximises the likelihood. This is intuitively appealing, and later we will show it is a theoretically justified choice. The MLE should be found using an appropriate maximisation technique.

  • 3

    If the parameter is continuous, we can often (but not always) find the MLE by considering the derivative of the log-likelihood. If the parameter is discrete, we usually evaluate the likelihood at a range of possible values.

    DON’T JOIN UP POINTS WHEN PLOTTING THE LIKELIHOOD FOR A DISCRETE PARAMETER.

    DO NOT DIFFERENTIATE LIKELIHOODS OF DISCRETE PARAMETERS!

Chapter 13 Information and Sufficiency

13.1 Introduction

Last time we looked at some more examples of the method of maximum likelihood. When the parameter of interest, θ, is continuous, the MLE, θ^, can be found by differentiating the log-likelihood and setting it equal to zero. We must then check the second derivative of the log-likelihood is negative (at our candidate θ^) to verify that we have found a maximum.

Definition.

Suppose we have a sample 𝐱=x1,,xn, drawn from a density f(𝐱|θ) with unknown parameter θ, with log-likelihood l(θ|𝐱). The score function, S(θ), is the first derivative of the log-likelihood with respect to θ:

S(θ|𝐱)=l(θ|𝐱)=θl(θ|𝐱).

This is just giving a name to something we have already encountered.

As discussed previously, the MLE solves S(θ^)=0. Here, f(𝐱|θ) is being used to denote the joint density of 𝐱=x1,,xn. For the iid case, f(𝐱|θ)=i=1nf(xi|θ). Also, l(θ|𝐱)=logf(𝐱|θ). This is all just from the definitions.

Definition.

Suppose we have a sample 𝐱=x1,,xn, drawn from a density f(𝐱|θ) with unknown parameter θ, with log-likelihood l(θ|𝐱). The observed information function, IO(θ), is MINUS the second derivative of the log-likelihood with respect to θ:

IO(θ|𝐱)=-l′′(θ|𝐱)=-2θ2l(θ|𝐱).

Remember that the second derivative of l(θ) is negative at the MLE θ^ (that’s how we check it’s a maximum!). So the definition of observed information takes the negative of this to give something positive.

The observed information gets its name because it quantifies the amount of information obtained from a sample. An approximate 95% confidence interval for θtrue (the unobservable true value of the parameter θ) is given by

(θ^-1.96IO(θ^),θ^+1.96IO(θ^)).

This confidence interval is asymptotic, which means it is accurate when the sample is large. Some further justification on where this interval comes from will follow later in the course.

What happens to the confidence interval as IO(θ^) changes?

TheoremExample 13.1.1 Mercedes Benz drivers

You may recall the following example from last year.The website MBClub UK (associated with Mercedes Benz) carried out a poll on the number of times taken to pass a driving test. The results were as follows.

Number of failed attempts 0 1 2 3
Observed frequency 147 47 20 5
Table 13.1: Number of times taken for drivers to pass the driving test.

As always, we begin by looking at the data.

obsdata<-c(147,47,20,5)
barplot(obsdata,names.arg=c(0:2, or more'),
xlab="Number of failed attempts",
ylab="Frequency",col="orange")

Next, we propose a model for the data to begin addressing the question.

It is proposed to model the data as iid (independent and identically distributed) draws from a geometric distribution.

Why is this a suitable model?

What assumptions are being made?

Are these assumptions reasonable?

The probability mass function (pmf) for the geometric distribution, where X is defined as the number of failed attempts, is given by

Pr[X=x]=θ(1-θ)x,

where x=0,1,2,.

Assuming that the people in the ‘3 or more’ column failed exactly three times, the likelihood for general data x1,,xn is

L(θ)=i=1nθ(1-θ)xi,

and the log-likelihood is

l(θ) =i=1nlog{θ(1-θ)xi}
=i=1n{log(θ)+xilog(1-θ)}
=nlog(θ)+log(1-θ)i=1nxi.

The score function is therefore

S(θ)=l(θ)=nθ-i=1nxi1-θ.

A candidate for the MLE, θ^, solves S(θ^)=0:

  1. 1

    nθ^=i=1nxi1-θ^,

  2. 2

    n(1-θ^)=θ^i=1nxi,

  3. 3

    n=θ^(n+i=1nxi),

  4. 4

    θ^=nn+i=1nxi.

To confirm this really is an MLE we need to verify it is a maximum, i.e. a negative second derivative.

l′′(θ)=-nθ2-i=1nxi(1-θ)2<0.

In this case the function is clearly negative for all θ(0,1), if not we would just need to check this is the case at the proposed MLE.

Now plugging in the numbers, n=219 and i=1nxi=0×147+1×47+2×20+3×5=102, we get

θ^=219219+102=0.682.

This is the same answer as the ‘obvious one’ from intuition.

But now we can calculate the observed information at θ^, and use this to construct a 95% confidence interval for θtrue.

IO(θ^) =-l′′(θ^)
=nθ^2+i=1nxi(1-θ^)2
=2190.6822+102(1-0.682)2
=1479.5.

Now the 95% confidence interval is given by

(l,u) =(θ^-1.96IO(θ^),θ^+1.96IO(θ^))
=(0.682-1.961479.5,0.682+1.961479.5)
=(0.631,0.733).

We should also check the fit of the model by plotting the observed data against the theoretical data from the model (with the MLE plugged in for θ).

#value of theta: MLE
mletheta<-0.682
#expected data counts
expdata<-219*c(dgeom(0:2,mletheta),1-pgeom(2,mletheta))
#make plot
barplot(rbind(obsdata,expdata),names.arg=c(0:2, or more'),
xlab="Number of failed attempts",ylab="Frequency",
col=c("orange","red"),beside=T)
#add legend
legend("topright",c("observed","expected"),
col=c("orange","red"),lty=1)

We can do actually do slightly better than this.

We assumed ‘the people in the “3 or more” column failed exactly three times’. With likelihood we don’t need to do this. Remember: the likelihood is just the joint probability of the data. In fact, people in the “3 or more” group have probability

Pr[X3] =1-(Pr[X=0]+Pr[X=1]+Pr[X=2])
=1-(θ+(1-θ)θ+(1-θ)2θ).

We could therefore write the likelihood more correctly as

L(θ)=i=1n{θ(1-θ)xi}zii=1n{1-(θ+(1-θ)θ+(1-θ)2θ)}1-zi,

where zi=1 if xi<3 and zi=0 if xi3.

NOTE: if all we know about an observation x is that it exceeds some value, we say that x is censored. This is an important issue with patient data, as we may lose contact with a patient before we have finished observing them. Censoring is dealt with in more generality MATH335 Medical Statistics.

What is the MLE of θ using the more correct version of the likelihood?

The term in the second product (for the censored observations) can be seen as a geometric progression with constant term a=θ and common ratio r=(1-θ), and so Pr(X3|θ)=(1-θ)3 (check that this is the case).

Hence the likelihood can be written

L(θ) =θnu(1-θ)xi((1-θ)3)nc
=θnu(1-θ)xi+3nc

where the sum of xi’s only involves the uncensored observations, nu denotes the number of uncensored observations, and nc is the number of censored observations.

The log-likelihood becomes l(θ)=nulog(θ)+(xi+3nc)log(1-θ).

Differentiating, the score function is

S(θ)=l(θ)=nuθ-xi+3nc1-θ.

A candidate MLE solves l(θ^)=0, giving

nuθ^ =xi+3nc1-θ^
nu(1-θ^) =θ^(xi+3nc)
nu =θ^(nu+xi+3nc)
θ^ =nunu+xi+3nc.

The value of the MLE using these data is 214214+102=0.677.

Compare this to the original MLE of 0.682.

Why is the new estimate different to this?

Why is the difference small?

13.2 Suppression of Information

Last time we introduced the score function (the derivative of the log-likelihood), and the observed information function (MINUS the second derivative of the log-likelihood). The score function is zero at the MLE. The observed information function evaluated at the MLE gives us a method to construct confidence intervals.

We will now study the concept of observed information in more detail.

TheoremExample 13.2.1 Human Genotyping

Humans are a diploid species, which means you have two copies of every gene (one from your father, one from your mother). Genes occur in different forms; this is what leads to some of the different traits you see in humans (e.g. eye colour). Mendelian traits are a special kind of trait that are determined by a single gene.

Having wet or dry earwax is a Mendelian trait. Earwax wetness is controlled by the gene ABCC11 (this gene lives about half way along chromosome 16). We will call the wet earwax version of ABCC11 W, and the dry version w. The wet version is dominant, which means you only need one copy of W to have wet earwax. Both copies of the gene need to be w to get dry earwax.

The Hardy-Weinberg law of genetics states that if W occurs in a (randomly mating) population with proportion p (so w occurs with proportion (1-p)) potential combinations in humans obey the proportions:

combination WW Ww ww
proportion p2 2p(1-p) (1-p)2

Suppose I take a sample of 100 people and assess the wetness of their earwax. I observe that 87 of the people have wet earwax and 13 of them have dry earwax.

I am actually interested in p, the proportion of copies of W in my population.

Show that the probability of a person having wet earwax is p(2-p), and that the probability of a person having dry earwax is (1-p)2. Also show that these two probabilities sum to 1.

The number of people with wet earwax in my sample is therefore Binomial(100,p(2-p)). So

Pr[obs|p]=(10087){p(2-p)}87{(1-p)2}13.

IMPORTANT FACT: when writing down the likelihood, we can always omit multiplicative constants, since they become additive in the log-likelihood, then disappear in the differentation. A multiplicative constant is one that does not depend on the parameter of interest (here p).

So we can write down the likelihood as

L(p) {p(2-p)}87{(1-p)2}13
={p(2-p)}87(1-p)26.

So the log likelihood is

l(p) =87log{p(2-p)}+26log(1-p)
=87log(p)+87log(2-p)+26log(1-p)

(plus constant).

Now p is a continuous parameter so a suitable way to find a candidate MLE is to differentiate. The score function is

S(p)=l(p)=87p-872-p-261-p.

We can solve S(p^)=0; it is as a quadratic in p^:

  1. 1

    87(2-p)(1-p)-87p(1-p)-26p(2-p)=0,

  2. 2

    200p^2-400p^+174=0,

  3. 3

    400±4002-4.200.1742.200=p^.

This gives two solutions but we need p^[0,1] as it is a proportion, so get p^=0.639 as our potential MLE.

The second derivative is

l′′(p)=-87p2-87(2-p)2-26(1-p)2.

This is clearly <0 at p^, confirming that it is a maximum.

The observed information is obtained by substituting p^ into -l′′(p), giving

IO(p^)=870.6392+87(2-0.639)2+26(1-0.639)2=459.5.

Hence an approximate 95% confidence interval for ptrue is given by

(l,u) =(p^-1.96IO(p^),p^+1.96IO(p^))
=(0.639-1.96459.5,0.639+1.96459.5)
=(0.548,0.730).

After all that derivation, don’t forget the context. This is a 95% confidence interval for the proportion of people with a W variant of ABCC11 gene in the population of interest.

Suppose that, instead of looking in people’s ears to see whether their wax is wet or dry we decide to genotype them instead, thereby knowing whether they are WW, Ww or ww.

This is a considerably more expensive option (although perhaps a little less disgusting) so a natural question is: what do we gain by doing this?

We take the same 100 people and find that 42 are WW, 45 are Ww and 13 are ww. Think about how this relates back to the earwax wetness. Did we need to genotype everyone?

The likelihood function for p given our new information is

L(p)  (p2)42{2p(1-p)}45{(1-p)2}13
=p84{2p(1-p)}45(1-p)26.

The log-likelihood is

l(p) =84log(p)+45log{2p(1-p)}+26log(1-p)
=84log(p)+45log(2)+45log(p)+45log(1-p)+26log(1-p)
=129log(p)+71log(1-p)+c.

where c is a constant.

As before, p is continuous so we can find candidates for the MLE by differentiating:

S(p)=l(p)=129p-711-p.

Now solving S(p^)=0 gives a candidate MLE

  1. 1

    129p^=711-p^,

  2. 2

    129(1-p^)=71p^,

i.e.

p^=129200=0.645.

This is our potential MLE. Checking the second derivative

l′′(p)=-129p2-71(1-p)2,

which is <0 at p^ confirming that it is a maximum.

The observed information is obtained by substituting p^ into -l′′(p), giving

IO(p^)=1290.6452+71(1-0.645)2=873.5.

Hence an approximate 95% confidence interval for ptrue is given by

(l,u) =(p^-1.96IO(p^),p^+1.96IO(p^))
=(0.645-1.96873.5,0.645+1.96873.5)
=(0.579,0.711).

Now, compare the confidence intervals and the observed informations from the two separate calculations. What do you conclude?

Of course, genotyping the participants of the study is expensive, so may not be worthwhile. If this was a real problem, the statistician could communicate the figures above to the geneticist investigating gene ABCC11, who would then be able to make an evidence-based decision about how to conduct the experiment.

13.3 Sufficiency

Recall the driving test data from the Example 13.1.

Number of failed attempts 0 1 2 3
Observed frequency 147 47 20 5
Table 13.2: Number of times taken for drivers to pass the driving test.

We chose to model these data as being geometrically distributed. Assuming that the people in the ‘3 or more’ column failed exactly three times, the log-likelihood for general data x1,,xn is

l(θ) =i=1nlog{θ(1-θ)xi}
=i=1n{log(θ)+xilog(1-θ)}
=nlog(θ)+log(1-θ)i=1nxi.

Now, suppose that, rather than being presented with the table of passing attempts, you were simply told that with 219 people filling in the survey, i=1219xi=102.

Would it still be possible to proceed with fitting the model?

The answer is yes; moreover, we can proceed in exactly the same way, and achieve the same results! This is because, if you look at the log-likelihood, the only way in which the data is involved is through i=1nxi, meaning that in some sense, this is all we need to know.

This is clearly a big advantage, we just have to remember one number rather than an entire table.

We call i=1nxi a sufficient statistic for θ.

Definition.

Let 𝐱=x1,,xn be a sample from f(|θ). Then a function of the data T(𝐱) is said to be a sufficient statistic for θ (or sufficient for θ) if 𝐱 is independent of θ given T(𝐱), i.e.

Pr[𝐗=𝐱|T(𝐱),θ]=Pr[𝐗=𝐱|T(𝐱)].

Some consequences of this definition:

  • 1

    For the objective of learning about θ, if I am told T(𝐱), there is no value in being told anything else about 𝐱.

  • 2

    If I have two datasets 𝐱𝟏 and 𝐱𝟐, and T(𝐱𝟏)=T(𝐱𝟐), then I should make the same conclusions about θ from both, even if 𝐱𝟏𝐱𝟐.

  • 3

    Sufficient statistics always exist since trivially T(𝐱)=𝐱 always satisfies the above definition.

Definition.

Let 𝐱=x1,,xn be a sample from f(|θ). Let T(𝐱) be sufficient for θ. Then T(𝐱) is said to be minimally sufficient for θ if there is no sufficient statistic with a lower dimension than T.

Theorem (Neyman factorisation theorem).

Let x=x1,,xn be a sample from f(|θ). Then a function T(x) is sufficient for θ if and only if the likelihood function can be factorised in the form

L(θ)=g(𝐱)×h(T(𝐱),θ),

where g is a function of the data only, and h is a function of the data only through t(x).

For a proof see page 276 of Casella and Berger.

We can also express the factorisation result in terms of the log-likelihood, which is often easier, just by taking logs of the above result:

l(θ) =log{g(𝐱)×h(T(𝐱),θ)}
=log{g(𝐱)}+log{h(T(𝐱),θ)}
=g~(𝐱)+h~(T(𝐱),θ),

where g~=log(g) and h~=log(h).

We can show that i=1nxi is sufficient for θ in the driving test example by inspection of the log-likelihood:

l(θ)=nlog(θ)+log(1-θ)i=1nxi.

Letting T(𝐱)=i=1nxi , then h~(T(𝐱),θ)=nlog(θ)+log(1-θ)T(𝐱) , and g~(𝐱)=0, we have satisfied the factorisation criterion, and hence T(𝐱)=i=1nxi is sufficient for θ.

Suppose that I carry out another survey on attempts to pass a driving test, again with n=219 participants and get data y=y1,,yn, with 𝐱𝐲 but i=1nxi=i=1nyi. Are the following statements true or false?

  1. 1

    θ^(𝐱), the MLE based on data 𝐱, is the same as θ^(𝐲), the MLE based on data 𝐲.

  2. 2

    The confidence intervals based on both datasets will be identical.

  3. 3

    The geometric distribution is appropriate for both datasets.

An important shortcoming in only considering the sufficient statistic is that it does not allow us to check how well the chosen model fits.

TheoremExample 13.3.1 Poisson parameter (cont.)

Recall from the beginning of this section, the London homicides data, which we modelled as a random sample from the Poisson distribution. We found

L(λ|x1,,xn) =i=1nλxiexp(-λ)xi!
=λixiexp(-nλ)i=1n1xi!
λixiexp(-nλ),

and that the log-likelihood function for the Poisson data is consequently

l(λ)=log(λ)i=1nxi-nλ+c,

with the MLE being

λ^=i=1nxin=x¯.

By differentiating again, we can find the information function

l′′(λ|𝐱)=-λ-2i=1nxi,

and so

IO(λ|𝐱)=λ-2i=1nxi.

What is a sufficient statistic for the Poisson parameter?

For this case, we can let T(𝐱)=i=1nxi, and h~(T(𝐱),θ)=log(λ)T(𝐱)-nλ, and g~(𝐱)=c=-i=1nlog(xi!), we have satisfied the factorisation criterion, and hence T(𝐱)=i=1nxi is sufficient for λ.

TheoremExample 13.3.2 Normal variance

Suppose the sample x1,,xn comes from XN(0,θ). Find a sufficient statistic for θ. Is the MLE a function of this statistic or of the sample mean? Give a formula for the 95% confidence interval of θ.

First, the Normal(0,θ) density is given by

f(xi|θ)=12πθexp{-xi22θ},

leading to the likelihood

  1. 1

    L(θ)=i=1n12πθexp{-xi22θ},

  2. 2

    L(θ)=1θn/2exp{-ixi22θ}.

Hence, T(𝐱)=ixi2 is a sufficient statistic for θ. The log-likelihood and score functions are

  1. 1

    l(θ)=-n2logθ-ixi22θ,

  2. 2

    S(θ)=l(θ)=-n2θ+ixi22θ2.

Solving S(θ)=0 gives a candidate MLE

θ^=ixi2n,

which is a function of the sufficient statistic. To check this is an MLE we calculate

l′′(θ)=n2θ2-ixi2θ3.

In this case it isn’t immediately obvious that l′′(θ^)<0, but substituting in

l′′(θ^) =n2(xi2n)2-xi2(xi2n)3
=n32(xi2)2-n3(xi2)2
=-n32(xi2)2<0,

confirming that this is an MLE.

The observed information is IO(θ^)=-l′′(θ^),

IO(θ^)=n32(xi2)2.

Therefore a 95% confidence interval is given by

(l,u) =(θ^-1.96IO(θ^),θ^+1.96IO(θ^))
=(ixi2n-1.96n-3/2xi22,ixi2n+1.96n-3/2xi22).

13.4 Summary

{mdframed}
  • 1

    The score function is the first derivative of the log-likelihood. The observed information is MINUS the second derivative of the log-likelihood. It will always be positive when evaluated at the MLE.

    DO NOT FORGET THE MINUS SIGN!

  • 2

    The likelihood function adjusts appropriately when more information becomes available. Observed information does what it says. Higher observed information leads to narrower confidence intervals. This is a good thing as narrower confidence intervals mean we are more sure about where the true value lies.

    For a continuous parameter of interest, θ, the calculation of the MLE and its confidence interval follows the steps:

    1. 1

      Write down the likelihood, L(θ).

    2. 2

      Write down the log-likelihood, l(θ).

    3. 3

      Work out the score function, S(θ)=l(θ).

    4. 4

      Solve S(θ^)=0 to get a candidate for the MLE, θ^.

    5. 5

      Work out l′′(θ). Check it is negative at the MLE candidate to verify it is a maximum.

    6. 6

      Work out the observed information, IO(θ^)=-l′′(θ).

    7. 7

      Calculate the confidence interval for θtrue:

      (θ^-1.96IO(θ^),θ^+1.96IO(θ^)).
  • 3

    Changing the data that your inference is based on will change the amount of information, and subsequent inference (e.g. confidence intervals).

  • 4

    A statistic T(𝐱) is said to be sufficient for a parameter θ, if 𝐱 is independent of θ when conditioning on S(𝐱).

  • 5

    An equivalent, and easier to demonstrate condition is that the likelihood can be factorised in the form L(θ)=g(𝐱)×h(T(𝐱),θ), iff T(𝐱) is sufficient.

Chapter 14 Distribution of the MLE

14.1 Recalling randomness

We have noted that an asymptotic 95% confidence interval for a true parameter, θ, is given by

(θ^-1.96IO(θ^),θ^+1.96IO(θ^)),

where θ^ is the MLE and

IO(θ|𝐱)=-l′′(θ|𝐱)=-2θ2l(θ|𝐱),

is the observed information.

In this lecture we will sketch the derivation of the distribution of the MLE, and show why the above really is an asymptotic 95% confidence interval for θ.

Recall the distinction between an estimate and an estimator.

Given a sample X1,,Xn, an estimator is any function W(X1,,Xn) of that sample. An estimate is a particular numerical value produced by the estimator for given data x1,,xn.

The maximum likelihood estimator is a random variable; therefore it has a distribution. A maximum likelihood estimate is just a number, based on fixed data.

For the rest of this lecture we consider an iid sample X1,,Xn, from some distribution with unknown parameter θ, and the MLE (maximum likelihood estimator) θ^(𝐗).

Definition.

The Fisher information of a random sample X1,,Xn is the expected value of minus the second derivative of the log-likelihood, evaluated at the true value of the parameter:

IE(θ)=𝔼[-2θ2l(θ|𝐗)].

This is related to, but different from, the observed information.

  • 1

    The observed information is calculated based on observed data; the Fisher information is calculated taking expectations over random data.

  • 2

    The observed information is calculated at θ^, the Fisher information is calculated at θtrue.

  • 3

    The observed information can be written down numerically; the Fisher information usually cannot be since it depends on θtrue, which is unknown.

TheoremExample 14.1.1 Fisher Information for a Poisson parameter

Suppose 𝐱 is a random sample from XPoisson(θtrue). Find the Fisher information. Remember that 𝔼[X]=θtrue. For θ>0,

L(θ)=f(𝐱|θ) =i=1ne-θθxixi!
=e-nθθixi×c

where c is a constant.

  1. 1

    logf(𝐱|θ)=-nθ+ixilogθ+c,

  2. 2

    θlogf(𝐱|θ)=ixiθ-n,

  3. 3

    2θ2logf(𝐱|θ)=-ixiθ2,

  4. 4

    2θ2logf(𝐗|θ)=-iXiθ2.

Hence

IE(θtrue) =𝔼(iXiθtrue2)
=nθtrueθtrue2=nθtrue.

We see that our answer is in terms of θtrue, which is unknown (and not in terms of the data!) The Fisher information is useful for many things in likelihood inference, to see more take MATH330 Likelihood Inference.

Here, it features in the most important theorem in the course.

Theorem (Asymptotic distribution of the maximum likelihood estimator).

Suppose we have an iid sample X=X1,,Xn from some distribution with unknown parameter θ, with maximum likelihood estimator θ^(X). Then (under certain regularity conditions) in the limit as n

θ^(𝐗)N(θ,IE-1(θ)).

This says that, for n large, the distribution of the MLE is approximately normal with mean equal to the true value of the parameter, and variance equal to the reciprocal of the Fisher information.

We will not prove the result in this course, but it has to do with the central limit theorem (from MATH230).

Turning this around, this means that, for large n,

Pr[θ(θ^(𝐗)-1.96IE-1(θ),θ^(𝐗)-1.96IE-1(θ))]0.95.

This result is useless as it stands, because we can only calculate IE(θ) when we know θ, and if we know it, why are we constructing a confidence interval for it?!

Luckily, the result also works asymptotically if we replace IE(θ) by IO(θ^), giving that

(θ^(𝐱)-1.96IO(θ^(𝐱)),θ^(𝐱)+1.96IO(θ^(𝐱)))

is an approximate 95% confidence interval for θ (as claimed earlier).

Exam Question

A large batch of electrical components contains a proportion θ which are defective and not repairable, a proportion 3θ which are defective but repairable and a proportion 1-4θ which are satisfactory.

  • (a)

    What values of θ are admissible?

Fifty components are selected at random (with replacement) from the batch, of which 2 are defective and not repairable, 5 are defective and repairable and 43 are satisfactory.

  • (b)

    Write down the likelihood function, L(θ) and make a rough sketch of it.

  • (c)

    Obtain the maximum likelihood estimate of θ.

  • (d)

    Obtain an approximate 95% confidence interval for θ. A value of θ equal to 0.02 is believed to represent acceptable quality for the batch. Do the data support the conclusion that the batch is of acceptable quality?

Solution:

  1. a

    There are 3 types of component, each giving rise to a constraint on θ:

    1. 1

      0θ1,

    2. 2

      03θ1,

    3. 3

      01-4θ1,

    as the components each need to have valid probabilities. The third inequality is sufficient for the other two and gives 0θ1/4.

  2. b

    Given the data, the likelihood is

    L(θ) θ2(3θ)5(1-4θ)43
    θ7(1-4θ)43.

    For the sketch note that L(0)=L(1/4)=0 and the function is concave and positive between these two with a maximum closer to 0 than 1/4.

  3. c

    To work out the MLE, we differentiate the (log-)likelihood as usual. The log-likelihood is

    l(θ)=7logθ+43log(1-4θ).

    Differentiating,

    l(θ)=7θ-4×431-4θ.

    A candidate MLE solves l(θ^)=0, giving θ^=7200.

    Moreover,

    l′′(θ)=-7θ2-4×4×43(1-4θ)2<0,

    so this is indeed the MLE.

  4. d

    The observed information is

    IO(θ^) =-l′′(θ^)
    =7θ^2+4×4×43(1-4θ^)2
    =5714.3+930.2
    =6644.5.

    So a 95% confidence interval for θ is

    (θ^-1.96IO(θ^),θ^+1.96IO(θ^))
    =(0.0110,0.0590).

    As 0.02 is within this confidence interval there is no evidence of this batch being sub-standard.

14.2 Summary

{mdframed}
  • 1

    Under certain regularity conditions, the maximum likelihood estimator has, asymptotically, a normal distribution with mean equal to the true parameter value, and variance equal to the inverse of the Fisher information.

  • 2

    The Fisher information is minus the expectation of the second derivative of the log-likelihood evaluated at the true parameter value.

  • 3

    Based on this, we can construct approximate 95% confidence intervals for the true parameter value based on the MLE and the observed information.

  • 4

    Importantly, this is an asymptotic result so is only approximate. In particular, it is a bad approximation to a 95% confidence interval when the sample size, n, is small.

Chapter 15 Deviance and the LRT

15.1 Deviance-based confidence intervals

In the last lecture we showed that the MLE is asymptotically normally distributed, and we use this fact to construct an approximate 95% confidence interval.

In this lecture we will introduce the concept of deviance, and show that this leads to another way to calculate approximate confidence intervals that have various advantages.

We will begin by showing through an example where things can go wrong with the confidence intervals we know (and love?).

TheoremExample 15.1.1 An evening at the casino

On a fair (European) roulette wheel there is a 1/37 probability of each number coming up.

In the early 1990s, Gonzalo Garcia-Pelayo believed that casino roulette wheels were not perfectly random, and that by recording the results and analysing them with a computer, he could gain an edge on the house by predicting that certain numbers were more likely to occur next than the odds offered by the house suggested. This he did at the Casino de Madrid in Madrid, Spain, winning 600,000 euros in a single day, and one million euros in total.

Legal action against him by the casino was unsuccessful, it being ruled that the casino should fix its wheel:

Suppose I am curious that the number 17 seems to come up on a casino’s roulette wheel more frequently than other numbers. I track it for 30 spins, during which it comes up 2 times. I decide to carry out a likelihood analysis on p, the probability of the number 17 coming up, and its confidence interval.

We propose to model the situation as follows. Let R be the number of times the number 17 comes up in 30 spins of the roulette wheel. We decide to model RBinomial(30,p).

Why is this a suitable model?

What assumptions are being made?

Are these assumptions reasonable?

The probability of the observed data is given by

Pr[obs|p]=(302)p2(1-p)28.

The likelihood is simply the probability of the observed data, but we can ignore the multiplicative constants, so

L(p)p2(1-p)28.

The log-likelihood is

l(p)=2logp+28log(1-p).

Differentiating,

l(p)=2p-281-p.

Now remember solutions to l(p)=0 are potential MLEs:

  1. 1

    2p^=281-p^,

  2. 2

    2-2p^=28p^,

  3. 3

    p^=230.

The second derivative will both tell us whether this is a maximum, and provide the observed information:

l′′(p)=-2p2-28(1-p)2.

This is clearly negative for all p(0,1), so p^ must be a maximum.

Moreover, the observed information is

IO(p^)=-l′′(p^) =2p^2+28(1-p^)2
=450+32.413
=482.143.

A 95% confidence interval for p is given by

(p^-1.96IO(p^),p^+1.96IO(p^)),

which, on substituting in p^ and the observed information becomes

(230-1.96482.143,230+1.96482.143)=(-0.023,0.156).

The resulting confidence interval includes negative values (for a probability parameter). What’s the problem??

Let’s look at a plot of the log-likelihood for the above situation.

loglik<-function(p){
2*log(p) + 28*log(1-p)
}
p<-seq(from=0.01,to=0.25,length=1000)
plot(p,loglik(p),type="l")

We notice that the log-likelihood is quite asymmetric. This happens because the MLE is close to the edge of the feasible space (i.e. close to 0). The confidence interval defined above is forced to be symmetric, which seems inappropriate here.

Definition.

Suppose we have a log-likelihood function with unknown parameter θ, l(θ). Then the deviance function is given by

D(θ)=2{l(θ^)-l(θ)}.

Notice that D(θ)0, and D(θ^)=0.

What can we say about D(θ)?

This is a fixed (but unknown) value for fixed data 𝐱=x1,,xn. However, in similar spirit to the last lecture, we can consider random data 𝐗=X1,,Xn. Now, the deviance function depends on 𝐗 (since different data leads to different likelihoods). So, D(θ,𝐗) is a random variable.

Theorem 2 (Asymptotic distribution of the deviance).

Suppose we have an iid sample X=X1,,Xn from some distribution with unknown parameter θ. Then (under certain regularity conditions) in the limit as n,

D(θ,𝐗)χ12,

i.e. the deviance of the true value of θ has a χ2 distribution with one degree of freedom.

The practical upshot of this result is that we have another way to construct a confidence interval for θ. A 95% confidence interval for θ, for example, is given by {θ:D(θ)<3.84}, i.e. any values of θ whose deviance is smaller than 3.84.

TheoremExample 15.1.2 An evening at the casino continued

This property of the deviance is best seen visually. Going back to the roulette data:

deviance<-function(p){
2*(loglik(2/30)-loglik(p))
}
plot(p,deviance(p),type="l")
abline(h=3.84)

From the graph we can estimate the confidence interval based on the deviance. In fact the exact answer to three decimal places is (0.011,0.192). Notice that this is not symmetrical, and that all values in the interval are feasible.

The original motivation for all of this was that we were wondering if the number 17 comes up more often than with the 1/37 that should be observed in a fair roulette wheel.

In fact 1/37=0.027, which is within the 95% confidence interval calculated above. Hence there is insufficient evidence (so far) to support the claim that this number is coming up more often than it should.

Notes (summary)

  • 1

    We have now seen two different ways to calculate approximate confidence intervals (CI) for an unknown parameter. Previously, we calculated CI based on the asymptotic distribution of the MLE (CI-MLE). Here, we showed how to calculate the CI based on the asymptotic distribution of the deviance (CI-D).

  • 2

    We discussed various differences and pros and cons of the two:

    1. 1

      CI-MLE is always symmetric about the MLE. CI-D is not.

    2. 2

      CI-MLE can include values with zero likelihood (e.g. infeasible values such as negative probabilities, as seen here). CI-D will only include feasible values.

    3. 3

      CI-D is typically harder to calculate than CI-MLE.

    4. 4

      For reasons we will not go into here, CI-D is typically more accurate than CI-MLE.

    5. 5

      CI-D is invariant to re-parametrization; CI-MLE is not. (This is a good thing for CI-D, that we will learn more about in subsequent lectures).

  • 3

    Overall, CI-D is usually preferred to CI-MLE (since the only disadvantage is that it is harder to compute).

  • 4

    DEVIANCES ARE ALWAYS NON-NEGATIVE!

15.2 Re-parametrization and Invariance

TheoremExample 15.2.1 Accident and Emergency continued

In our likelihood examples we discussed modelling inter-arrival times at an A&E department using an Exponential distribution. The exponential pdf is given by

f(x)=λexp(-λx)

for x0 and λ0, where λ is the rate parameter.

Based on the inter-arrival times (in minutes):

18.39,2.70,5.42,0.99,5.42,31.97,2.96,5.28,8.51,10.90,

giving x¯=9.259, we came up with the MLE for λ of λ^=1x¯=0.108.

Now, 𝔼[X]=μ=1/λ.

How would we go about finding an estimate for μ?

Method 1: re-write the pdf as

f(x)=1μexp(-xμ),

where x0 and μ0, to give a likelihood of

L(μ)=i=1n1μexp(-xiμ),

then find the MLE by the usual approach.

Method 2: Since μ=1/λ, presumably μ^=1/λ^=1/0.108=9.259.

Which method is more convenient?

Which method appears more rigorous?

In fact, both methods give the same solution always. This property is called invariance to reparameterization of the MLE. It is a nice property both because it agrees with our intuition, and saves us a lot of potential calculation.

Theorem (Invariance of MLE to reparametrisation.).

If θ^ is the MLE of θ and ϕ is a monotonic function of θ, ϕ=g(θ), then the MLE of ϕ is ϕ^=g(θ^).

Proof.

Write 𝐱=(x1,x2,,xn). The likelihood for θ is L(θ)=f(x|θ), and for ϕ is Lϕ(ϕ). Note that θ=g-1(ϕ) as g is monotonic and define ϕ^ by g(θ^). To show that ϕ^ is the MLE,

Lϕ(ϕ) =f(𝐱|ϕ)
=f(𝐱|g-1(ϕ))f(𝐱|θ^)

as θ^ is MLE. But

f(𝐱|θ^) =f(𝐱|g-1(ϕ^))
=f(𝐱|ϕ^)=Lϕ(ϕ^).

This means that both methods above must give the same answer.

Exercise.

Show this works for the case above, by demonstrating that Method 1 leads to μ^=x¯=9.259.

The following corollary follows immediately from invariance of the MLE to reparametrisation.

Corollary.

Confidence intervals based on the deviance are invariant to reparametrisation, in the sense that

{ϕ:D(g-1(ϕ))3.84}={θ:D(θ)3.84}.
Proof.
{θ:D(θ)3.84} ={θ:2(l(θ^)-l(θ))3.84}
={ϕ:2(l(g-1(ϕ^))-l(g-1(ϕ)))3.84}

by Theorem above, which equals

{ϕ:D(g-1(ϕ))3.84}.

The practical consequence of this is that if

(θl,θu) is a deviance confidence interval with coverage p for θ𝑡𝑟𝑢𝑒,

then

(g(θl),g(θu)) is a deviance confidence interval with coverage p for ϕ𝑡𝑟𝑢𝑒.

(Of course, ϕ=g(θ)).

IMPORTANT: This simple translation does not hold for confidence intervals based on the asymptotic distribution to the MLE. This is because that depends on the second derivative of l() with respect to the parameter, which will be different in more complicated ways for different parameter choices.

This will be explored more in MATH330 Likelihood Inference.

Exam Question

  1. a

    The random variables X1,X2,,Xn are independent and identically distributed with the geometric distribution

    f(x|θ)=θx(1-θ),x=0,1,2,

    where θ is a parameter in the range of 0θ1 to be estimated. The mean of the above geometric distribution is θ/(1-θ).

    1. i

      Write down formulae for the maximum likelihood estimator for θ and for Fisher’s information;

    2. ii

      Write down what you know about the distribution of the maximum likelihood estimator for this example when n is large.

  2. b

    In a particular experiment, n=10, i=1nxi=10.

    1. i

      Compute an approximate 95% confidence interval for θ based on the asymptotic distribution of the maximum likelihood estimator;

    2. ii

      Compute the deviance D(θ) and sketch it over the range 0.1θ0.9. Use your sketch to describe how to use the deviance to obtain an approximate 95% confidence interval for θ;

    3. iii

      If you were asked to produce an approximate 95% confidence interval for the mean of the distribution θ/(1-θ), what would be your recommended approach? Justify your answer.

Solution:

  1. a
    1. i

      For the model, the likelihood function is

      L(θ|𝐗) =i=1nθXi(1-θ)
      =(1-θ)nθXi.

      The log-likelihood is then

      l(θ|𝐗)=nlog(1-θ)+Xilog(θ),

      with derivative

      l(θ|𝐗)=-n1-θ+Xiθ.

      A candidate MLE solves l(θ^)=0, giving

      θ^=Xin+Xi.

      Moreover,

      l′′(θ|𝐗)=-n(1-θ)2-Xiθ2<0,

      so this is indeed the MLE.

      For the Fisher Information,

      IE(θ) =𝔼[-l′′(θ|𝐗)|θ=θ]
      =𝔼[n(1-θ)2-Xiθ2]
      =n(1-θ)2+nθ2𝔼[X1]
      =nθtrue(1-θ)2,

      after simplification, since 𝔼[X1]=θ/(1-θ).

    2. ii

      Using the Fisher information, the asymptotic distribution of the MLE is

      θ^(𝐗)N(θtrue,IE-1(θtrue))N(θtrue,I0-1(θ^)).
  2. b
    1. i

      Using the data, the MLE is θ^=1010+10=12. The observed information is

      IO(θ^)=10(1-1/2)2+10(1/2)2=80.

      Therefore a 95% confidence interval is

      (1/2-1.9680,1/2+1.9680)=(0.281,0.719).
    2. ii

      The deviance is given by

      D(θ) =2{l(θ^)-l(θ)}
      =2{10log(1/2)+10log(1/2)-10log(1-θ)-10log(θ)}
      =20(-2log2-log(θ(1-θ))).

      To plot the deviance calculate D(0.1) and D(0.9), and note that D(0.5)=D(θ^)=0. A 95% confidence interval is obtained by drawing a horizontal line at 3.84; the interval is all θ with D(θ)3.84.

    3. iii

      To construct a confidence interval for the mean, we would use the mean function on the deviance-based confidence interval just calculated, as this is invariant to re-parametrization.

15.3 Summary

{mdframed}
  • 1

    The simple, intuitive answer is true: if θ^ is a MLE, then if ϕ=g(θ) for any monotonic transformation g, then ϕ^=g(θ^).

  • 2

    The same simple result can be applied to confidence intervals based on the deviance, but can NOT be applied to confidence intervals based on the asymptotic distribution of the MLE.