Robert_V._Hogg,_Joseph_W._McKean,_Allen_T._Craig

(Jacob Rumans) #1
298 Some Elementary Statistical Inferences

Thenα̂is our simulated estimate ofαand the half-width of a confidence interval
forαserves as our estimate of the error of estimation.
The R functionempalphacnimplements this algorithm. We ran it forN =
10 ,000 obtaining the results:
No. Simulat. Empirical̂α Error 95% CI forα
10,000 0.0412 0.0039 (0. 0373 , 0 .0451)
Based on these results, thet-test appears to be conservative when the sample is
drawn from this contaminated normal distribution.

4.8.1 Accept–Reject Generation Algorithm


In this section, we develop theaccept–rejectprocedure that can often be used to
simulate random variables whose inverse cdf cannot be obtained in closed form. Let
Xbe a continuous random variable with pdff(x). For this discussion, we call this
pdf thetargetpdf. Suppose it is relatively easy to generate an observation of the
random variableY which has pdfg(x) and that for some constantMwe have
f(x)≤Mg(x), −∞<x<∞. (4.8.5)

We callg(x)theinstrumentalpdf. For clarity, we write the accept–reject as an
algorithm:


Algorithm 4.8.1(Accept–Reject Algorithm). Letf(x)be a pdf. Suppose thatY
is a random variable with pdfg(y),Uis a random variable with a uniform(0,1)
distribution,YandUare independent, and (4.8.5) holds. The following algorithm
generates a random variableXwith pdff(x).



  1. GenerateYandU.

  2. IfU≤Mgf(Y(Y)), then takeX=Y. Otherwise return to step 1.


3.Xhas pdff(x).

Proof of the validity of the algorithm:Let−∞<x<∞.Then


P[X≤x]=P

[
Y≤x|U≤

f(Y)
Mg(Y)

]

=

P

[
Y≤x, U≤Mgf((YY))

]

P

[
U≤Mgf(Y(Y))

]

=

∫x
−∞

[∫f(y)/M g(y)
0 du

]
g(y)dy
∫∞
−∞

[∫
f(y)/M g(y)
0 du

]
g(y)dy

=

∫x
−∞

f(y)
Mg(y)g(y)dy
∫∞
−∞

f(y)
Mg(y)g(y)dy

(4.8.6)

=

∫x

−∞

f(y)dy. (4.8.7)
Free download pdf