Homework 18, Due Wednesday Nov 25, 2009. (but you may hand this assignment IN CLASS on Monday November 30.) ======================================== Devise a Markov Chain Monte Carlo simulation to generate a sample of 1000 (approximately) independent random points uniformly distributed in the region A of R^7 (7-dimensional Euclidean space defined as the intersection of the 15 linear inequalities (for x =c(x1,x2,x3,x4,x5,x6,x7): carr %*% x > c(-3,-2,0,-1,-10,3,-8,-5,-2,-4,-1,-4,0,2,-5,-2) where carr is given by > carr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.04 -1.18 -1.28 1.98 0.04 -1.48 -0.34 [2,] 1.54 -0.86 0.32 1.68 0.06 -1.24 -1.84 [3,] 1.96 -0.64 -0.02 -0.34 1.14 -1.02 0.40 [4,] -0.34 -0.42 -1.24 1.30 1.94 -1.50 -0.04 [5,] -1.48 -1.26 -0.22 -1.92 -1.18 -1.66 0.54 [6,] -0.68 1.24 0.82 -1.12 0.08 1.74 1.16 [7,] -1.96 -1.64 -1.96 -0.86 -1.98 -0.06 2.00 [8,] -1.98 -0.04 0.66 1.20 -0.96 -0.96 -1.84 [9,] 1.76 0.16 1.04 -1.32 -1.48 -1.04 0.32 [10,] 0.12 -0.46 -0.06 -0.68 -1.48 -0.56 0.14 [11,] -1.52 -1.60 0.88 1.58 -0.04 -0.62 1.00 [12,] -0.66 -1.78 0.68 0.22 -1.70 1.66 0.28 [13,] -1.00 0.30 1.04 1.26 -0.52 -0.08 0.98 [14,] 0.78 1.14 -0.34 -0.78 0.84 -0.56 1.36 [15,] -1.16 -1.72 0.48 1.04 -0.44 0.82 -1.94 [16,] 0.13 0.44 -0.64 -0.15 -0.09 0.27 -0.52 NOTE that the point rep(1,7) satisfies all of these inequalities, so that the intersection is the (open, convex) interior of a polyhedron in R^7. HINT: one way to define a "proposal" transition density q(y|x) is to find the density of the following two successive steps: (1) choose a direction v in R^7 at random (i.e., a unit vector uniformly distributed on the surface of the unit sphere) , and (2) make the successor state to x uniformly distributed on the segment (x+t*v, tmin < t < tmax) where tmax is the smallest positive number such that x+tmax*v falls of=n the boundary of the region A, and tmin is the largest negative number such that x+tmin*v falls of=n the boundary of the region A. (As we will show in class: this transition density defines a reversible chain on A with respect to the uniform density: so Metropolis Hastings with this proposal density always accepts the newly simulated point !) After coding a Metropolis-Hastings algorithm: perform several checks to make sure that your coded proposal steps ALWAYS take you from one point in the interior of A to another, and that the resulting Markov chain (after a long burn-in period which you specify) has converged to a stationary and "mixing" Markov sequence.