Solve the following problem:
Consider the target density
f(x) = (exp-x2/2/√2π ) 4(x-.3)2 + .01/ 4(1+(.3)2)+.01
a. Show that f integrates to 1 and that it is a bimodal density.
b. Implement a normal random walk Metropolis-Hastings algorithm with a small variance like .04, and use plot.mcmc, cumuplot, and heidel.diag to assess the convergence when starting from x = - 2 and x = 2.
c. Compare those assessments with an on-line evaluation of the integral R f(x) d x based on the MCMC sample thus produced.