Speedier convergence with adaptive metropolis hastings

The attached file implements the Adaptive Metropolis Hastings algorithm of Haario, Saksman and Tamminen. Generally speaking, its performance is significantly better than the standard random-walk metropolis hastings when dealing with DSGEs, in the sense that it explores the posterior distribution more efficiently and more accurately. But of course, YMMV.

It is backwards-compatible with the standard Dynare implementation. To turn on the adaptive MH computation, include these lines before the “estimation” command:

global amh_t0; amh_t0 = 20000;
Reducing the value of amh_t0 will start the adaptation earlier, at the risk of mis-estimating the covariance matrix.

This code is based on some stand-alone work by Kristoffer Nimark and Francisco Barillas. Maximum respect to them; all errors are mine.
random_walk_metropolis_hastings.m (8.11 KB)