Question: 4. Suppose that the posterior for a parameter, , is N.0; 1/: (a) Create a computer program which carries out Monte Carlo integration (see (1.12))
4. Suppose that the posterior for a parameter, , is N.0; 1/:
(a) Create a computer program which carries out Monte Carlo integration (see
(1.12)) to estimate the posterior mean and variance of . (Note: Virtually any relevant computer package such as MATLAB or Gauss will have a function which takes random draws from the standard Normal.)
(b) How may replications are necessary to ensure that the Monte Carlo estimates of the posterior mean and variance are equal to their true values of 0 and 1 to three decimal places?
(c) To your computer program, add code which calculates numerical standard errors (see (1.13)). Experiment with calculating posterior means, standard deviations, and numerical standard errors for various values of S. Do the numerical standard errors give a reliable indication of the accuracy of approximation in the Monte Carlo integration estimates?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
