rmcgibbo / pyhmc

Hamiltonain Monte Carlo in Python
https://pythonhosted.org/pyhmc
Other
37 stars 17 forks source link

The 0.5 scale in the leapfrog method in hmc_main_loop in _hmc.pyx #16

Closed xuhuifan closed 6 years ago

xuhuifan commented 6 years ago

Hi Robert,

I found that in line 109 of the _hmc.pyx, there is an additional 0.5 scale in updating p (the full ), while as in standard HMC method (Neal's MCMC using Hamiltonian dynamics) there is no such term. May I ask if I have mis-understood anything?

Thanks, Xuhui

rmcgibbo commented 6 years ago

sorry, i don't have the band with to track it down. i think you can find that term if you follow back the chain of ownership of this project, e.g. to the python and matlab functions in https://github.com/koepsell/pyhmc. best of luck.

xuhuifan commented 6 years ago

Thanks, Robert. This is what I was concerned. In you link, both of the hmc2.m and hmc2.py do not contain the 0.5 scale factor. Please see line 357 of https://github.com/koepsell/pyhmc/blob/master/hmc2.py and line 199 of https://github.com/koepsell/pyhmc/blob/master/hmc2.m

Xuhui

rmcgibbo commented 6 years ago

Got it. How about you fix it with a pull request?

Sent from my iPhone

On Aug 15, 2018, at 5:48 PM, Xuhui Fan notifications@github.com wrote:

Thanks, Robert. This is what I was concerned. In you link, both of the hmc2.m and hmc2.py do not contain the 0.5 scale factor. Please see line 357 of https://github.com/koepsell/pyhmc/blob/master/hmc2.py and line 199 of https://github.com/koepsell/pyhmc/blob/master/hmc2.m

Xuhui

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

xuhuifan commented 6 years ago

Great. Pushing a PR now. Thanks,