Skip to content
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

Misleading documentation for pymc.normal_like #175

Closed
strumke opened this issue Jan 30, 2018 · 4 comments
Closed

Misleading documentation for pymc.normal_like #175

strumke opened this issue Jan 30, 2018 · 4 comments

Comments

@strumke
Copy link

strumke commented Jan 30, 2018

Hi!
The documentation [1] for pymc.normal_like fails to mention that it actually returns the logarithm of the function, as the source code [2] reveals in the following lines

like = 0.0
like = like - 0.5 * tau_tmp * (x(i)-mu_tmp)**2
like = like + 0.5dlog(0.5tau_tmp/PI)

[1] https://pymc-devs.github.io/pymc/distributions.html#pymc.distributions.normal_like
[2] https://github.com/pymc-devs/pymc/blob/8733c6686787e0e98bd2445ea5408fe988adf0c9/pymc/flib.f

Thanks!

@fonnesbeck
Copy link
Member

The documentation does say log-likelihood:

However, if you have ways of improving the docs, we always welcome pull requests!

@strumke
Copy link
Author

strumke commented Jan 31, 2018 via email

@fonnesbeck
Copy link
Member

I see what you mean. The log-likelihood is just a computational convenience for doing more stable statistical computation, whereas users generally think of distributions in terms of its PDF/PMF, and not the log-transformed scale, so we present those in the documentation. Most users will not have to worry about the fact that the distributions are log-transformed, except when more advanced computations are required. That’s a good point, though, and we should probably state that the formula of PDF/PMF is displayed in the docs.

@strumke
Copy link
Author

strumke commented Jan 31, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants