Homework 6 in STAT400: Computational Statistics @ CSU
Be sure to set.seed(400)
at the beginning of your
homework.
Develop two Monte Carlo integration approaches to estimate \(\int\limits_0^5 x^2 \exp(-x) dx\). (You
must use different distributions in the two approaches). Check your
answer using the integrate()
function.
Estimating the cdf of a normal distribution. Use \(m = 1000\).
R
function pnorm()
for \(x = 0.5,
1, 2, 3\). Summarise your findings comparing the performance of
the methods.Compute a Monte Carlo estimate \(\hat{\theta}_1\) of \[ \theta = \int\limits_0^{0.5} e^{-x} dx \] by sampling from the Uniform(\(0, 0.5\)) and estimate the variance of \(\hat{\theta}_1\). Find another Monte Carlo estimator \(\hat{\theta}_2\) by sampling from the Exponential(1) distribution and estimating its variance.
Which of the variances (of \(\hat{\theta}_1\) or \(\hat{\theta}_2\)) is smaller?
Turn in in a pdf of your homework to canvas. Your .Rmd file on the server will also be used in grading, so be sure they are identical and reproducible.