-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add user-friendly logp and logcdf methods #4833
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
Conversation
c451165
to
72e8ea5
Compare
0792aaa
to
7f60337
Compare
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 like it!
That reduces one breaking v3
→v4
change to something less painful:
my_rv = pm.Normal.dist(0, 2)
# on v3:
my_rv.logp(1.5).eval()
# on v4.
pm.logp(my_rv, 1.5).eval()
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.
Generally speaking, don't do too much with respect to the likelihood calculations in PyMC, because we're ultimately going to set PyMC up to use aeppl
. Since this looks more like a PyMC-specific interface change, that might not be an issue, though.
Yeah, this one is actually mimicking a bit what we have in aeppl just to extract a logp/logcdf of a vanilla RV |
fbb0033
to
d6866fc
Compare
Codecov Report
@@ Coverage Diff @@
## main #4833 +/- ##
==========================================
+ Coverage 72.31% 72.32% +0.01%
==========================================
Files 85 85
Lines 13877 13884 +7
==========================================
+ Hits 10035 10042 +7
Misses 3842 3842
|
40826e2
to
e35217b
Compare
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.
bad luck
e35217b
to
528edc7
Compare
This PR adds a
logp
helper similar to thelogcdf
that already existed to facilitate the extraction oflogp
andlogcdf
expressions, similar to how the.logp
and.logcdf
methods worked inv3
:The file
distributions/logp.py
was renamed todistributions/logprob.py
to avoid the the name conflict.