HW 18 Stat 705 Fall 2017 -------------------------- Assigned 11/24/2017, due 12/4 14 points ============================== Assigned Friday 11/24/17 DUE Monday 12/4/17 ---------------------------------------------- Read in the dataset "precip" from the base-R datasets, containing average amount of annual precipitation (rainfall) in inches for each of 70 United States (and Puerto Rico) cities. (A) Find the following types of density estimate for these rainfall amounts, viewed as iid observations from a (with-replacement) random sample of a large number of possible cities. (i) A kernel density estimate with rectangular (Unif(-1/2,1/2)) density and bandwidth 2. (ii) A kernel density estimate with the normal(0,1) density, also with bandwidth 2. Comment on the density estimates (i) versus (ii) as a good visual representation of the data, e.g. versus a histogram with 10 bars. (iii) Find the best kernel-density estimate with dlogis(x) kernel for these data, optimized over the bandwidth h with respect to the Integrated-Squared Error criterion over the interval (5,70) for x, using the kernel-window dlogis(x,y,h) and approximating to the 12-bin histogram regarded as a density function for the "precip" data. (iv) Fit the Maximum Likelihood estimated mixture of 3 normally distributed components based on the "precip" dataset. (Find the maximum likelihood mixture-distribution parameters either by numerical maximization or EM, and check via gradients in either case that your ML estimation has converged properly.) Explain whether and why you think that a 3-component mixture was a good choice for these data. (B) Hand in the R code which you used in answering the questions in (A), and display all of the density curves on a single plot, if possible, containing also the scaled relative frequency histogram for the "precip" data (with 12 bars). Make sure that your plot is properly labeled, using color and/or line-types to distinguish the different density curves, and make sure your plot has a descriptive legend. If you cannot fit all of this stuff into one readable picture use two pictures.