Homework Problem 8, Due Monday October 10, 2016. ------------------------------------------------------ Assigned 9/28/2016, due 10/10. IN THIS HOMEWORK, YOU WILL BE GRADED ON THE CLARITY OF YOUR EXPLANATIONS AS MUCH AS ON THE CORRECTNESS OF YOUR CODE. (1) Generate 10,000 standard normal N(0,1) random variates, and put them in an array Zmat of dimensions 500 x 20. (i) Check empirically across i=1,...500 that the number of rows i in which the numbers of Z[i,j] elements j=1,...,20 falling in the respective intervals A1 = (-Inf,-1], A2 = (-1,0], A3 = (0,1], A4 = (1,Inf) has the expected distribution. Provide a formal statistical test of this "expected distribution" as a null hypothesis for the independent sets of counts N_{ki} = \sum_{j=1}^{20} I{Z[i,j] in Ak} , k=1,..,4 (ii) In how many of the rows i do you see at least one |Z[i,j]| value > qnorm(.9995) ? Is this an unexpectedly large (or small) number ? Explain your reasoning in terms of probability approximations and limit theorems. What is the expected number of such rows ? #--------------------------------------- (2) We want to simulate a large number (>10^6) of independent identically distributed pseudo-random variable values from the density f(x) = C0/(1+x^2+3*x^4)^3, for all x where C0 is a constant that makes f a proper density. Find the most computationally efficient method you can find of doing this, WHICH PROVABLY SIMULATES RANDOM VARIABLES WITH THIS DENSITY TO AN ACCURACY WITHIN 10^(-6) IN THE DISTRIBUTION FUNCTION F(x). I expect that the most efficient such method will be a well-chosen Accept-Reject algorithm. Provide a timing run to generate 10^6 variates from the density f according to your method, and give the ratio of the time it takes to do this divided by the time it takes to generate 10^6 uniform[0,1] random variates in R on your computer. Also give a clear argument explaining how you know or have tested that the algorithm generates variates with density f to high accuracy.