Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skipping the Hastings computation for symmetric proposals #41

Closed
luiarthur opened this issue Nov 23, 2020 · 2 comments
Closed

Skipping the Hastings computation for symmetric proposals #41

luiarthur opened this issue Nov 23, 2020 · 2 comments

Comments

@luiarthur
Copy link
Contributor

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.

@cpfiffer
Copy link
Member

cpfiffer commented Nov 23, 2020

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?

@luiarthur
Copy link
Contributor Author

luiarthur commented Nov 23, 2020

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.)

luiarthur added a commit to luiarthur/AdvancedMH.jl that referenced this issue Dec 8, 2020
luiarthur added a commit to luiarthur/AdvancedMH.jl that referenced this issue Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants