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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started