Robert_V._Hogg,_Joseph_W._McKean,_Allen_T._Craig

(Jacob Rumans) #1
296 Some Elementary Statistical Inferences

ThenY is a unbiased estimator ofπ.NotethatY is estimating a mean, so the
large sample confidence interval (4.2.6) derived in Example 4.2.2 for means can be
used to estimate the error of estimation. Recall that this 95% confidence interval is
given by
(y− 1. 96 s/



n,y+1. 96 s/


n),

wheresis the value of the sample standard deviation. We coded this algorithm
in the R functionpiest2. The table below gives the results for estimates ofπfor
various runs of different sample sizes along with the confidence intervals.


n 100 1000 10,000 100,000
y 3.217849 3.103322 3.135465 3.142066
y− 1 .96(s/


n) 3.054664 3.046330 3.118080 3.136535
y+1.96(s/


n) 3.381034 3.160314 3.152850 3.147597
Note that for each experiment the confidence interval trappedπ.
Numerical integration techniques have made great strides over the last 30 years.
But the simplicity of integration by Monte Carlo still makes it a powerful technique.
As Theorem 4.8.1 shows, if we can obtainFX−^1 (u) in closed form, then we can
easily generate observations with cdfFX. In many cases where this is not possible,
techniques have been developed to generate observations. Note that the normal
distribution serves as an example of such a case, and, in the next example, we show
how to generate normal observations. In Section 4.8.1, we discuss an algorithm that
can be adapted for many of these cases.
Example 4.8.5(Generating Normal Observations).To simulate normal variables,
Box and Muller (1958) suggested the following procedure. LetY 1 ,Y 2 be a random
sample from the uniform distribution over 0<y<1. DefineX 1 andX 2 by
X 1 =(−2logY 1 )^1 /^2 cos(2πY 2 ),
X 2 =(−2logY 1 )^1 /^2 sin(2πY 2 ).


This transformation is one-to-one and maps{(y 1 ,y 2 ):0<y 1 < 1 , 0 <y 2 < 1 }
onto{(x 1 ,x 2 ):−∞<x 1 <∞,−∞<x 2 <∞}except for sets involvingx 1 =0
andx 2 = 0, which have probability zero. The inverse transformation is given by


y 1 =exp

(

x^21 +x^22
2

)
,

y 2 =
1
2 π

arctan
x 2
x 1
.

This has the Jacobian

J =

∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣
(−x 1 )exp

(

x^21 +x^22
2

)
(−x 2 )exp

(

x^21 +x^22
2

)

−x 2 /x^21
(2π)(1 +x^22 /x^21 )

1 /x 1
(2π)(1 +x^22 /x^21 )

∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣ =

−(1 +x^22 /x^21 )exp

(

x^21 +x^22
2

)

(2π)(1 +x^22 /x^21 )
=

−exp

(

x^21 +x^22
2

)

2 π
.
Free download pdf