kthohr / mcmc

A C++ library of Markov Chain Monte Carlo (MCMC) methods
https://mcmclib.readthedocs.io/en/latest/
Apache License 2.0
166 stars 45 forks source link

Inconsistent results with bounds? #12

Open brian-bk22 opened 8 months ago

brian-bk22 commented 8 months ago

When using multiple runs of the same MCMC algorithm (and settings) with bounds, sometimes it will return a 0 acceptance rate and fail, while other runs will work as expected. Our hopeful use case would be to provide R wrappers to your fast MCMC samplers with custom bounded density functions, but the instability has us concerned.

To simplify the issue and provide a hopefully reproducible example, take the HMC example with Eigen in the package documentation. If bounds are added between 1.55 and 50 for both parameters, it fails >10% of the time. But when I increase the lower bound to 1.65, the algorithm almost always fails. Does this have to do with the step-size? Or am I missing something?