2 Hypothesis Tests and Confidence Intervals

Example: Failure Times

An engineer is interested in understanding the failure time of a particular engine component. He undertakes an experiment where 10 independent copies of a component are tested separately and their lifetime (in hours) measured, leading to the following data:

      90 255  40 143  30 239 484  28  39  15

What conclusions can be made about the mean failure time?

Our first decision is what probability model to use for our data. This is an important part of the modelling process; formal model choice procedures will be described later in the module.

For now, our informal procedure, recalled from MATH235 is: plot the data first, and check the model fit after finding the MLE (e.g. using a QQ plot).

We first take a look at the data; for example we could use the R code

fail<-c(90,255,40,143,30,239,484,28,39,15)
stripchart(fail,pch=4,xlab="failure times (in hours)")

This leads to the strip plot in Figure 2.1.

For lifetime data of this sort, for reasons that were developed in the MATH230 course, a common model for such data (not least because the failure times are bound to be non-negative) is the exponential distribution, with rate parameter θ and mean θ-1.

Thus, we will assume that our data x1,x2,,xn (where n=10, but we’ll work more generally for the moment) are independent realisations of independent random variables, X1,X2,,Xn, each having the Exponential(θ) distribution.

Figure 2.1: Link, Caption: Strip plot of failure data

Assuming the exponential distribution, for each of the Xi,

f(xi|θ)=θe-θxi    (xi>0),with θΩ=(0,).

Hence:

L(θ) = i=1nθe-θxi    (θ>0)
= θne-θi=1nxi

and

(θ)=nlogθ-θi=1nxi=nlogθ-θnx¯.

So

S(θ)=(θ)=nθ-nx¯

and for a stationary point (θ^)=0. Hence,

θ^=1x¯

which is verified as a maximum since

′′(θ)=-nθ2<0for all θ>0.

Thus, we obtain θ^=1/x¯ as the maximum likelihood estimator of θ: for our data this leads to θ^=0.00734.

The 95% confidence interval for θ based on the asymptotic normality of θ^ is given by

θ^±zα/2[IE(θ^)]-1/2

where zα/2=1.96 and

IE(θ) = E[-d2(θ;X)dθ2]
= E[nθ2]
= nθ2.

So, replacing IE(θ) by IE(θ^) the interval becomes

0.00734±1.96/10/(0.00734)2=(0.00279,0.0119).

For comparison, we can now calculate an approximate 95% confidence interval based on the deviance.

The deviance is given by

D(θ) = 2{nlog1x¯-nx¯x¯-nlogθ+θnx¯}
= 2{10log1x¯-10-10logθ+10θx¯}.

From χ12 tables, for a 95% interval, we need to solve D(θ)=3.84. This is a non-linear equation in θ; to solve it we plot D(θ) and look for the intersections with the D(θ)=3.84 line.

From Figure Figure 2.2 (Link), this leads to the interval (0.0037,0.013).

Figure 2.2: Link, Caption: Deviance function for θ based on failure time data assumed iid Exponential

At this point, recall that inferences are required not about θ, but about the mean of the population, ϕ=1/θ, i.e. g(θ)=1/θ. We could go right back to the start of the problem, replace θ with 1/ϕ, and do the whole thing again working with ϕ instead of θ.

However, because of the invariance property of the likelihood that’s not necessary: we get exactly the same results by simple transformation ϕ=1/θ of both the maximum likelihood estimate and the deviance-based confidence interval.

In other words,

ϕ^=1/θ^=x¯=136.3.

and the confidence interval becomes

(ϕ~l,ϕ~u)=(1/θ~u,1/θ~l)=(76.9,270.3).

For comparison, the confidence interval for the mean parameter ϕ based on the asymptotic normality of the MLE ϕ^ is (51.8,221).

Exercise 5: Verify that the confidence interval for ϕ based on asymptotic normality of the MLE ϕ^ is indeed (51.8,221).

Code for Figure Figure 2.2 (Link)

xbar<-mean(fail)

# function to calculate D(theta)
dev<-function(theta){
     2*(10*log(1/xbar) - 10 - 10*log(theta) + theta*10*xbar)
}

# a sequence of x-values at which to evaluate D(theta)
theta<-seq(from=0.001,to=0.02,length=1000)

plot(theta,dev(theta),type="l",ylab="deviance",xlim=c(0,0.02))


# add horizontal line
abline(h=3.84)

# find exact solutions via...
devroot<-function(theta){
     dev(theta)-3.84
}

# lower interval
uniroot(devroot,c(0.002,0.005))$root

# upper interval
uniroot(devroot,c(0.010,0.015))$root