Robert_V._Hogg,_Joseph_W._McKean,_Allen_T._Craig

(Jacob Rumans) #1

292 Some Elementary Statistical Inferences


x 01233 <x
Frequency 20 40 16 18 6

(a)Compute the corresponding chi-square goodness-of-fit statistic.
Hint: In computing the mean, treat 3<xasx=4.

(b)How many degrees of freedom are associated with this chi-square?

(c)Do these data result in the rejection of the Poisson model at theα=0. 05
significance level?

4.8 TheMethodofMonteCarlo.......................


In this section we introduce the concept of generating observations from a speci-
fied distribution or sample. This is often calledMonte Carlogeneration. This
technique has been used for simulating complicated processes and investigating fi-
nite sample properties of statistical methodology for some time now. In the last 30
years, however, this has become a very important concept in modern statistics in
the realm of inference based on the bootstrap (resampling) and modern Bayesian
methods. We repeatedly make use of this concept throughout the book.
For the most part, a generator of random uniform observations is all that is
needed. It is not easy to construct a device that generates random uniform observa-
tions. However, there has been considerable work done in this area, not only in the
construction of such generators, but in the testing of their accuracy as well. Most
statistical software packages, such as R, have reliable uniform generators.
Suppose then we have a device capable of generating a stream of independent
and identically distributed observations from a uniform (0,1) distribution. For
example, the following command generates 10 such observations in the language R:
runif(10). In this command therstands for random, theunifstands for uniform,
the 10 stands for the number of observations requested, and the lack of additional
arguments means that the standard uniform (0,1) generator is used.
For observations from a discrete distribution, often a uniform generator suffices.
For a simple example, consider an experiment where a fair six-sided die is rolled
and the random variableX is 1 if the upface is a “low number,” namely{ 1 , 2 };
otherwise,X= 0. Note that the mean ofXisμ=1/3. IfUhas a uniform (0,1)
distribution, thenXcan be realized as


X=

{
1if0<U≤ 1 / 3
0if1/ 3 <U< 1.

Using the command above, we used the following R code to generate 10 observations
from this experiment:


n = 10; u = runif(n); x = rep(0,n); x[u < 1/3] = 1; x


The following table displays the results.

Free download pdf