Robert_V._Hogg,_Joseph_W._McKean,_Allen_T._Craig

(Jacob Rumans) #1
4.8. The Method of Monte Carlo 297

Since the joint pdf ofY 1 andY 2 is 1 on 0<y 1 < 1 , 0 <y 2 <1, and zero elsewhere,
the joint pdf ofX 1 andX 2 is

exp

(

x^21 +x^22
2

)

2 π

, −∞<x 1 <∞, −∞<x 2 <∞.

That is,X 1 andX 2 are independent, standard normal random variables. One of the
most commonly used normal generators is a variant of the above procedure called
the Marsaglia and Bray (1964) algorithm; see Exercise 4.8.21.


Observations from a contaminated normal distribution, discussed in Section
3.4.1, can easily be generated using a normal generator and a uniform generator.
We close this section by estimating via Monte Carlo the significance level of at-test
when the underlying distribution is a contaminated normal.


Example 4.8.6.LetXbe a random variable with meanμand consider the hy-
potheses
H 0 :μ=0versusH 1 : μ> 0. (4.8.3)


Suppose we decide to base this test on a sample of sizen= 20 from the distribution
ofX,usingthet-test with rejection rule


RejectH 0 : μ=0infavorofH 1 :μ>0ift>t. 05 , 19 =1. 729 , (4.8.4)

wheret=x/(s/


20) andxandsare the sample mean and standard deviation,
respectively. IfXhas a normal distribution, then this test has level 0.05. But what
ifXdoes not have a normal distribution? In particular, for this example, suppose
Xhas the contaminated normal distribution given by (3.4.17) with =0.25 and
σc= 25; that is, 75% of the time an observation is generated by a standard normal
distribution, while 25% of the time it is generated by a normal distribution with
mean 0 and standard deviation 25. Hence the mean ofX is 0, soH 0 is true.
To obtain the exact significance level of the test would be quite complicated. We
would have to obtain the distribution oftwhenXhas this contaminated normal
distribution. As an alternative, we estimate the level (and the error of estimation)
by simulation. LetNbe the number of simulations. The following algorithm gives
the steps of our simulation:



  1. Setk=1,I=0.

  2. Simulate a random sample of size 20 from the distribution ofX.

  3. Based on this sample, compute the test statistict.

  4. Ift> 1 .729, increaseIby 1.

  5. Ifk=N;gotostep6;elseincreasekby 1 and go to step 2.

  6. Computêα=I/Nand the approximate error = 1. 96



α̂(1−̂α)/N.
Free download pdf