For the first week, we have a simple warm-up exercise for the discussion. Using R, generate 100 simulations of 30 samples each from a distribution (other than normal) of your choice. Graph the sampling distribution of means. Graph the sampling distribution of the minimum. Share your graphs and your R code. What did the simulation of the means demonstrate? What about the distribution of the minimum…?
(If you are unfamiliar with generating random variates in R, Google can help… rexp(), runif(), rpoi(),…)
sample_mean <- c()
sample_min <- c()
set.seed(888)
for (i in 1:100)
{
sample <- rpois(30, lambda = 10)
sample_mean[i] <- mean(sample)
sample_min[i] <- min(sample)
}
hist(sample_mean)
hist(sample_min)
I am creating 100 samples of poisson distribution, each of which contains 30 values. Presumably, the collection of samples will have sample mean of 10, because the lambda value was intially set to be 10. The mean of poisson distribution equals to the value of lambda. The result was further proved to be true according to the histogram of sample mean. This histogram has only one peak in the center near 10, and it is symmetric. If I collected more than 30 values of poisson ramdon variables, the bell shape curve will get narrower and narrower, but it will still center around 10. The histogram of the minimums of samples does not really follow any particular pattern. I can only tell the minimum has to be greater than 0 and less than 10.