Due: At the start of class on Thursday, October 13. Please turn in a hard copy.
Questions from PSE: 6.3, 6.6, 6.9, 6.12, 6.15
Additional Question
For this question, we are going to use Monte Carlo simulations to consider the theoretical properties of the sorts of estimators that we have been considering.
Part 1
Write a function called roll
that simulates rolling
a die (that is, it returns a number from 1 to 6 with equal
probabilities).
Write a function called generate_sample
that takes
an argument n
and generates a sample of \(n\) dice rolls.
Over 1000 Monte Carlo simulations (i.e., do the following 1000 times),
Generate a new sample with 10 observations
Calculate the sample average of the dice rolls for those 10 observations
Using all 1000 Monte Carlo simulations, report an estimate of the bias of \(\bar{X}\), the sampling variance of \(\bar{X}\), and an estimate of the mean squared error of your estimator.
Part 2
Repeat Part 1, but for \(n=2\). What differences do you notice?
Repeat Part 1, but for \(n=50\). What differences do you notice?
Repeat Part 1, but for \(n=1000\). What differences do you notice?
Part 3
Now suppose that you are interested in \(\beta = \log(\E[X])\). Repeat parts 1 and 2 except estimate \(\hat{\beta} = \log(\bar{X})\); for simplicity you can just use \(n=10\) and \(n=1000\) here. What do you notice?