TuringLang/AdvancedMH.jl

Skipping the Hastings computation for symmetric proposals

luiarthur opened this issue · 2 comments

In here and here, to compute the log acceptance probability (loga), the proposal density evaluated at the proposed and previous sample is always computed. However, this is not necessary if the proposal is symmetric, since q(spl, params_prev, params) - q(spl, params, params_prev) == 0.

Is there a reasonable way to check if the proposal is symmetric and, if it is, skip the Hastings part of the log acceptance probability computation?

I noticed this when looking at #39. The proposal is always Normal, so q doesn't need to be computed. I understand that there really isn't a computation bottleneck. But for multivariate proposals, it could be nice to avoid this unnecessary computation.

We could probably dispatch on certain proposal types -- if it's Normal or MvNormal, for example, we could just skip this computation. Are there any other commonly used symmetric proposal distributions we can add to the list?

For continuous unconstrained random variables, Normal and MvNormal are the go-to.

A Uniform proposal is also sometimes used. (e.g. x_proposed ~ Uniform(x_current - a, x_current  + a), where a is a tuning parameter that functions like the Normal proposal variance.) A caveat is that you need to be mindful of the support of the random variable. But using a Uniform should be kosher if the rv is unconstrained.

I've heard of symmetric heavy-tailed distribution like student-t or Cauchy being used as proposal distributions, though I haven't seen that in practice. Supposedly, you can better explore the tails of the distribution with a heavy-tailed proposal. (But I would think that once you're in the tails, it would take a long time to get back to the typical set.)