HW 15 Stat 705 Fall 2015 Assigned Wednesday 11/18/15 DUE Monday 11/30/15 (A) Read in the dataset "HW15data.txt" in the Data directory of the course web-page. It consists of 200 pairs of X_i,Y_i values, with -2 < X_i < 2. Fit the following curves y = g(x) to these data: (i) a polynomial regression of degree 4, (ii) a cubic smoothing spline with all points as knots, (iii) a B-spline regression with degree 3 and knots at -1,1 (iv) a local polynomial regression of degree 3. You may use the defaults in the R functions you call to do the fitting, but you should say what they are on these data. ALSO: find a way to display the raw scatterplot along with the 4 fitted curves in one or two pictures. Hand in the R code for your curve fits and the pictures. (B) Show how to simulate arbitrarily many pseudo-random variable values from the density (on the whole real line) given by f(x) = C *( exp(-x^2) + 2*exp(-2*abs(x-1)))*(1+x^2)^2 where C is a constant for you to find. Do the simulation by numerically approximating the inverse of the distribution function F(x) associated with f(x). Show in some way that your code actually does generate data from the desired density, and time a run in which you generate 10^5 simulated random variable values from this density.