STAT 428Spring 2010Homework 7Apr 21Homework 7Due in class on Friday, Apr 30.1.Consider the simulation of bivariate normal random variables. LetX= (X1, X2) and thetarget distribution isπ(x1, x2)∼Nparenleftbiggparenleftbigg00parenrightbigg,parenleftbigg10.50.51parenrightbiggparenrightbigg.Design a Gibbs sampler to generate samples approximately from the target distribution. Giveyour estimate of the mean ofX2. Plot the histogram ofX2based on your samples, and compare itwith the histogram based on i.i.d. samples fromN(0,1) (which is the true marginal distributionofX2).2.Consider the one-dimensional Ising model that we discussed in class. Letx= (x1, . . . , xd),wherexiis either +1 or-1. The target distribution isπ(x)∝expbraceleftBiggμd-1summationdisplayi=1xixi+1bracerightBigg.Letμ= 2,d= 40.(a) Design a Gibbs sampling algorithm to generate samples approximately from the target dis-tributionπ(x), and implement your algorithm in R. Attach the R code.(b) Suppose the output of your Gibbs sampling algorithm at steptisx(t)= (x(t)1, . . . , x(t)d).Define the total magnetizationM(t)=∑di=1x(t)i.
This is the end of the preview.
access the rest of the document.