joshspeagle / dynesty

Dynamic Nested Sampling package for computing Bayesian posteriors and evidences
https://dynesty.readthedocs.io/
MIT License
360 stars 79 forks source link

Add RandomTrajectory Sampler #13

Closed joshspeagle closed 6 years ago

joshspeagle commented 7 years ago

This is typically referred to "Galilean Monte Carlo (GMC)" (see, e.g., this). The basic idea is to initialize a particle with some velocity v and launch it in a random direction. It then proceeds unimpeded until it reflects off the likelihood boundary set by L_j > L_i, computed using the normal vector at that location. If the reflected particle is itself still outside the boundary, we reverse our trajectory. This procedure is analogous to Hamiltonian Monte Carlo (HMC) methods, except that our potential function is a uniform well with infinitely steep boundaries rather than a smooth log-posterior.

While the name makes sense (I believe it's a derivative of "Hamiltonian"), I find the whole MCMC analogues (and renaming) to be more confusing that enlightening at this point, especially concerning the underlying dynamics. For instance, the "MCMC"-like procedure employed to choose new live points is really a bounded random walk, so why not just call it a random walk? Likewise, Galilean MC is just a bounded random trajectory bouncing off surfaces, so why not just call it a random trajectory?

Notes:

joshspeagle commented 7 years ago

Linked wrong issue in the commit. I actually resolved #14.

joshspeagle commented 7 years ago

This has now been removed as of 1757c8e45b17dd5061a7f583024bd051b86c0901.

joshspeagle commented 6 years ago

I'm returning to this to see if I can get this implemented properly. I've thought a little bit more about how to get this to give numerically stable results and how to properly tune some of the parameters involved and think I might have a shot at getting this to work now.

joshspeagle commented 6 years ago

Looks like I thought wrong. Results were somewhat closer this time around (as in I got something working) but performance was still sub-optimal and required too much hand-tuning.

joshspeagle commented 6 years ago

I found this neat paper outlining how to actually do this properly using "Hamiltonian Slice Sampling". So I'm re-opening this since I think I can actually get that version implemented fingers crossed.