-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Better document the 'mr' parameter to 'metrop_select'. #7160
base: main
Are you sure you want to change the base?
Conversation
] |
@@ -181,7 +181,13 @@ def metrop_select(mr: np.ndarray, q: np.ndarray, q0: np.ndarray) -> tuple[np.nda | |||
|
|||
Parameters | |||
---------- | |||
mr: float, Metropolis acceptance rate | |||
mr: float, Metropolis acceptance rate. In theory, this acceptance rate is the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be summarized a bit more. Isn't it enough to say it's the logarithm of the ratio of probabilities?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In places where it is called, the variable passed in here is typically called delta_logp
. I wanted to explain the parameter in a way that explains the origin of the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand but it's too verbose in my opinion. Logarithm of probability ratio is pretty explicit. If you look in the database you'll quickly get used to seeing everything working on log scales
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter description should be (and should have been) on a different line, with only the parameter name and its type in the first line:
mr : float
description
which
can be
multiline
it looks like this class isn't on the website listed api docs so not fixing won't result in rendering errors unless/until it is added to the website.
I found myself confused why
metrop_select()
has this comparison:If
mr
was just a ratio of probabilities, as one would typically see in theoretical descriptions, then it should be compared touniform()
, not the log. Butmr
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/