-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
ENH: stats: Implement _logpdf, _sf and _isf for nakagami. #12958
Conversation
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.
LGTM modulo a small nit
Thanks, @ev-br; what is the small nit? I don't see any other comments. |
scipy/stats/_continuous_distns.py
Outdated
# nakagami.pdf(x, nu) = 2 * nu**nu / gamma(nu) * | ||
# x**(2*nu-1) * exp(-nu*x**2) | ||
return 2*nu**nu/sc.gamma(nu)*(x**(2*nu-1.0))*np.exp(-nu*x*x) | ||
return (np.log(2) + nu*np.log(nu) - sc.gammaln(nu) + | ||
(2*nu - 1)*np.log(x) - nu*x**2) |
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.
Nit, optional: xlogy(2*nu -1, x)
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.
OK, I've changed that, and I've changed nu*np.log(nu)
to xlogy(nu, nu)
.
Hm, I seem to be unable to use github today. Here's the small optional nit: |
Merged, thanks Warren. |
No description provided.