A random-walk Metropolis chain samples the unit Gaussian density with proposal width

PHYSICS · Multi-part · Fermi University Physics · Mathematical Methods for Physics · Computational Physics · Monte Carlo and lattice simulation of physical systems

Error, Chance and the Machine, Ch Markov-chain Monte Carlo

Problem

A random-walk Metropolis chain samples the unit Gaussian density p(x)∝e−x2/2p(x) \propto e^{-x^2/2} with proposal width 0.50.5. It runs for N=2×104N = 2\times10^4 steps from x=0x = 0 (PCG64, seed 6). The values of xx are cut into b=10b = 10 blocks of L=2000L = 2000 steps, and the block means, to be used as printed, are 0.094, 0.086, −0.021, −0.126, −0.078,−0.189, −0.055, 0.125, −0.093, 0.001.\begin{aligned}&0.094,\ 0.086,\ -0.021,\ -0.126,\ -0.078,\\ &-0.189,\ -0.055,\ 0.125,\ -0.093,\ 0.001.\end{aligned} The variance of xx in equilibrium is var(x)=1\mathrm{var}(x) = 1. ((a)) Find the mean xˉ\bar x and its blocked error from Eq. (11.12). ((b)) Merge neighbouring blocks in pairs, blocks 1 and 2, blocks 3 and 4, and so on, to make b=5b = 5 blocks of L=4000L = 4000 steps, and find the blocked error again. The scatter of a plateau estimated from bb blocks is about 1/2(b−1)1/\sqrt{2(b-1)} of its height. Do the two errors agree within it? ((c)) Find the naive error var(x)/N\sqrt{\mathrm{var}(x)/N}. Then use the blocked error of part (a) and Eq. (11.14) to estimate τint\tau_{\rm int} and NeffN_{\rm eff} of xx. ((d)) Is the mean consistent with the exact value 00? Are the blocks long enough for the blocked error to be trusted?

Browse the problem library