Homework 9

Due 2024-12-11 by midnight

  1. Using Rcpp and/or Armadillo, write an importance sampler code to determine the mean of the unscaled distribution f(x) = (2x)^{-x} for x > 0 . Use two different envelope functions. Name the C++ file importance.cpp and the R file importance.R.
  2. Submit this homework by committing the necessary files (including any data files) in the appropriate directory and pushing to your central Git repository. Ensure you do not commit files that are easily reproducible.