# Efficient MCMC using the normal approximation of the posterior

I can usually quickly get the normal approximation of the posterior distribution, but I sometimes struggle with setting up an efficient MCMC of the same model. Can I somehow use the results of the normal approximation to improve the MCMC? (I'm thinking about something along the lines of plugging in the approximate SD into the proposal SD of the MCMC.)

I use PyMC's NormApprox and MCMC classes, but I'm interested in suggestions using other frameworks as well.

Here's one way I have used normal approximations in MCMC:

- Figure out what what would be a Gibbs sampler*, apart from say one conditional distribution that is tricky to sample but which will be approximately normal.

* (possibly with some variables integrated out of some of the conditionals - you can show this will still have the right stationary distribution etc, even though it's no longer a full conditional)

- using a normal approximation (usually one found algebraically, which makes things a lot faster, but it doesn't have to be) as the candidate distribution, perform a Metropolis-Hastings step on that variable. If the approximation is good you'll nearly always take the step. To perform the step you only need to be able to evaluate the tricky density at two known values, not generate from it. This is usually substantially easier.

There are some particular conditions you need to hold if you're not going to end up stuck somewhere (to do with the relative heaviness of the tails of the proposal and the actual conditional distribution).

• (+1) Great answer. Can you point to some reference regarding the "particular conditions" that need to hold? – lacerbi Apr 6 '16 at 18:03

Gelman et al. (1996) showed that the optimal proposal distribution for a $d$-dimensional multivariate normal posterior with covariance matrix $\Sigma$ is a zero-mean multivariate normal with covariance matrix $5.76\Sigma / d$.

To make this statement more operational, I usually run my inference in three steps:

1. Use gradient-based optimisation to find the MAP estimate (assuming unimodal posterior)
2. Compute an estimate of the posterior covariance at the MAP estimate by evaluating the Hessian of the log posterior and inverting it
3. Run an MCMC sampler starting at the MAP estimate and with the proposal covariance discussed above

This will give you the optimal approach if your posterior is Gaussian and will work well if it is close to Gaussian.