Robert_V._Hogg,_Joseph_W._McKean,_Allen_T._Craig

(Jacob Rumans) #1
4.9. Bootstrap Procedures 305

LikewiseV(x∗i)=n−^1

∑n
i=1(xi−x)

(^2) ; see Exercise 4.9.2. At first glance, this re-
sampling the sample seems like it would not work. But our only information on
sampling variability is within the sample itself, and by resampling the sample we
are simulating this variability.
We now give an algorithm that obtains a bootstrap confidence interval. For
clarity, we present a formal algorithm, which can be readily coded into languages
such as R. Letx′=(x 1 ,x 2 ,...,xn) be the realization of a random sample drawn
from a cdfF(x;θ),θ∈Ω. Let̂θbe a point estimator ofθ.LetB, an integer, denote
the number of bootstrap replications, i.e., the number of resamples. In practice,B
is often 3000 or more.



  1. Setj=1.

  2. Whilej≤B, do steps 2–5.

  3. Letx∗j be a random sample of sizendrawn from the samplex.Thatis,the
    observationsx∗jare drawn at random fromx 1 ,x 2 ,...,xn, with replacement.

  4. Letθ̂∗j=θ̂(x∗j).

  5. Replacejbyj+1.

  6. Let̂θ(1)∗ ≤̂θ∗(2)≤ ··· ≤θ̂∗(B)denote the ordered values ofθ̂∗ 1 ,θ̂∗ 2 ,...,̂θ∗B.Let
    m=[(α/2)B], where [·] denotes the greatest integer function. Form the
    interval
    (θ̂∗(m),θ̂∗(B+1−m)); (4.9.5)
    that is, obtain the α 2 100% and (1−α 2 )100% percentiles of the sampling dis-
    tribution of̂θ 1 ∗,̂θ 2 ∗,...,θ̂∗B.


The interval in (4.9.5) is called thepercentile bootstrapconfidence interval for
θ. In step 6, the subscripted parenthetical notation is a common notation for order
statistics (Section 4.4), which is handy in this section.
For the remainder of this subsection, we use as our estimator ofθthe sample
mean. For the sample mean, the following R functionpercentcibootis an R im-
plementation of this algorithm (it can be downloaded at the site listed in Chapter
1):
percentciboot <- function(x,b,alpha){
theta=mean(x); thetastar=rep(0,b); n=length(x)
for(i in 1:b){xstar=sample(x,n,replace=T)
thetastar[i]=mean(xstar)}
thetastar=sort(thetastar); pick=round((alpha/2)*(b+1))
lower=thetastar[pick]; upper=thetastar[b-pick+1]
list(theta=theta,lower=lower,upper=upper)}
#list(theta=theta,lower=lower,upper=upper,thetasta=thetastar)}


The input consists of the samplex, the number of bootstrapsb, and the desired
confidence coefficientalpha. The second line of code computes the mean and the
Free download pdf