Question

Part D: 1. Draw 500 random samples of size 8 from a random number generator from a standard normal distribution. Then increas
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Draw 500 random samples of size 8 from a random number generator for a standard normal distribution. then increase the sample size to 32. Finally, increase the sample size to 128.

We given an R program for the simulation purpose. The 600 random samples is specified in "B <- 500" and the sample sizes of 8, 32, and 128 respectively through rnorm(8), rnorm(32) and rnorm(128).

> B <- 500
> bs8 = bs32 = bs128 <- NULL
> for(i in 1:B) {
+   bs8[i] <- mean(rnorm(8))
+   bs32[i] <- mean(rnorm(32))
+   bs128[i] <- mean(rnorm(128))
+ }
For each step, calculate the sample mean and the sample variance. 
> mean(bs8); mean(bs32); mean(bs128)
[1] -0.007853833
[1] 0.001011168
[1] -0.0021334
> var(bs8); var(bs32); var(bs128)
[1] 0.09262657
[1] 0.03790872
[1] 0.01066618
The simulation shows that as the sample size increases, the variability decreases.

Plot histograms of the sampling distributions of both estimator for each of these three sample sizes. 
> windows(height=15,width=5)
> par(mfrow=c(3,1))
> hist(bs8,main="CLT Based on Size 8")
> hist(bs32,main="CLT Based on Size 32")
> hist(bs128,main="CLT Based on Size 128")

CLT Based on Size 10 1.0 -0.5 0.0 0.5 10 bs10 CLT Based on Size 25 -0.6 -0.2 0.2 0.6 bs25 CLT Based on Size 100 -0.2 0.0 0.2

Repeat the same experiment with samples drawn from another distribution of your choice, for example an Uniform Distribution or a 2 -distribution. Discuss the results of these experiments in light of the CLT.

The normal distribution is replaced by a Gamma distribution and the previous R program is repeated all over again.

> B <- 500
> bsnonnormal08 = bsnonnormal32 = bsnonnormal128 <- NULL
> for(i in 1:B) {
+   bsnonnormal08[i] <- mean(rgamma(8,5,1.5))
+   bsnonnormal32[i] <- mean(rgamma(32,5,1.5))
+   bsnonnormal128[i] <- mean(rgamma(128,5,1.5))
+ }
> mean(bsnonnormal08); mean(bsnonnormal32); mean(bsnonnormal128)
[1] 3.309641
[1] 3.333957
[1] 3.332683
> var(bsnonnormal08); var(bsnonnormal32); var(bsnonnormal1228)
[1] 0.2112038
[1] 0.0860186
[1] 0.0228132
> windows(height=15,width=5)
> par(mfrow=c(3,1))
> hist(bsnonnormal08,main="CLT Based on Size 08")
> hist(bsnonnormal32,main="CLT Based on Size 32")
> hist(bsnonnormal128,main="CLT Based on Size 128")

CLT Based on Size 10 2.0 3.0 4.0 5.0 bsnonnormal10 CLT Based on Size 25 2.5 3.0 3.5 4.0 bsnonnormal25 CLT Based on Size 100 2

The reduction is sample variance is slower now.

Comment

Add a comment
Know the answer?
Add Answer to:
Part D: 1. Draw 500 random samples of size 8 from a random number generator from...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT