pymc-devs / pymc

Bayesian Modeling and Probabilistic Programming in Python
https://docs.pymc.io/
Other
8.67k stars 2k forks source link

Better document the 'mr' parameter to 'metrop_select'. #7160

Open bangerth opened 7 months ago

bangerth commented 7 months ago

I found myself confused why metrop_select() has this comparison:

    if np.isfinite(mr) and np.log(uniform()) < mr:

If mr was just a ratio of probabilities, as one would typically see in theoretical descriptions, then it should be compared to uniform(), not the log. But mr is the logarithm of the ratio -- something not clear from the documentation, but that can be added :-)


📚 Documentation preview 📚: https://pymc--7160.org.readthedocs.build/en/7160/

welcome[bot] commented 7 months ago

Thank You Banner] :sparkling_heart: Thanks for opening this pull request! :sparkling_heart: The PyMC community really appreciates your time and effort to contribute to the project. Please make sure you have read our Contributing Guidelines and filled in our pull request template to the best of your ability.