We will perform a Monte Carlo (i.e. simulation) analysis of confidence
intervals (CIs) for the mean. Recall that the CIs we constructed in class are supposed
to contain the true parameter about 95% of the time over repeated samples.
Since we already covered the exponential distribution in class, we’ll simulate from a
different distribution: the Poisson distribution. Note that the Poisson distribution is
a discrete distribution: a Poisson random variable takes on possible values 0, 1, 2, . . .,
rather than taking on any positive real number as with the exponential distribution. The Poisson distribution is indexed by a parameter λ, which is equal to the mean of
the distribution.
For n = 10, 50, 200 and B = 1000, run the following simulation exercise. Draw a
sample of size n from the Poisson distribution with λ = 5 (rpois(n, lambda=5) in
R). Do this B times, each time computing the sample mean and standard error, and
the endpoints of the 95% CI from the lecture notes (the one that adds and subtracts
two times the standard error). (a) Report a histogram of the sample mean over the B simulations (3
histograms, one for each sample size n).
(b) Report a histogram of the lower endpoint of the 95% CI, and another
histogram of the upper endpoint of the 95% CI (6 total histograms). (c) For each n, report the proportion of the B CIs that contain the
population mean. Is it close to 95%?
(d) Optional bonus question: repeat parts (b) and (c) using a bootstrap CI (you
can pick either of the bootstrap CIs we covered in class). This means that, for
each simulated sample b = 1, . . . , B, you will draw B bootstrap samples from
the simulated sample. Since this is computationally intensive (B2
total bootstrap
samples), try B = 100.
We will perform a Monte Carlo (i.e. simulation) analysis of confidence intervals
By admin