Question: Let's see the central limit theorem in action. Consider a random variableXthat is distributedGamma(0.1,1). Question 3:What is the mean and variance ofX? SimulateX10,000 times, and

Let's see the central limit theorem in action. Consider a random variableXthat is distributedGamma(0.1,1).

  • Question 3:What is the mean and variance ofX? SimulateX10,000 times, and simulate a normal random variableYwhich has the same mean and variance. Plot a histogram comparing the distribution ofXandY. Visually, how do the two distributions compare?
  • Hint: If you're usingggplot2, you can use theposition = "dodge"argument ingeom_histogramto plot the two histograms side-by-side in the same graph.
  • Question 4:Suppose we take the sample average ofNi.i.d. observations ofX. Let's denote this

sample averageXN. What is the mean and variance ofXN?

Question 5:Create function which intakes a numberN, and simulates an observation ofXN.

random variable with the same mean and variance asXN. Plot a histogram comparing the distribution

Simulate 10,000 observations ofXNwithN= 20, and simulate 10,000 observations ofYN, a normal

ofXNandYN. Repeat this exercise withN= 200andN= 2000. How do the distributions ofXNandYNcompare, particularly asNincreases?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!