Homework 9

Due 2016-11-18 by midnight

  1. Choose one problem from any previous homework assignment that can be parallelized. Rewrite the solution so that it runs in parallel.
  2. 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
  3. Use Rcpp/Armadillo to write a function that can be used in R that will run a multiple regression model. Have the function return the estimated coefficients, the variance of the estimated coefficients, the sum of squared errors, the R^2, and the F-statistic (basically mirroring the output from R's lm function). Do as much as possible using matrix algebra instead of sums and loops.
  4. Submit this homework by committing the necessary files (including any data files) in the appropriate directory and pushing to your central Git repository. Remember to not commit files that are easily reproducible.