-
-
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
Discrete uniform and hyper geometric moment #5167
Discrete uniform and hyper geometric moment #5167
Conversation
I am not quite sure why the |
pymc/distributions/discrete.py
Outdated
@@ -920,6 +920,12 @@ def dist(cls, N, k, n, *args, **kwargs): | |||
n = at.as_tensor_variable(intX(n)) | |||
return super().dist([good, bad, n], *args, **kwargs) | |||
|
|||
def get_moment(rv, size, N, k, n): | |||
mode = intX(at.floor((n + 1) * (k + 1) / (N + 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.
mode = intX(at.floor((n + 1) * (k + 1) / (N + 2))) | |
mode = at.floor((n + 1) * (k + 1) / (N + 2)) |
Should be fine without intX, we take care of that in the method that calls get_moment
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.
Sure, I removed it in the latest commit.
The get_moment should expect whatever is passed to |
Codecov Report
@@ Coverage Diff @@
## main #5167 +/- ##
==========================================
+ Coverage 78.05% 78.10% +0.04%
==========================================
Files 88 88
Lines 14142 14153 +11
==========================================
+ Hits 11039 11054 +15
+ Misses 3103 3099 -4
|
So whenever we create a |
Yes, that what will be used when we call get_moment internally |
Is the failing test related to this PR? |
Probably not, seems to be related to #4771 |
Seems good to me. You have some conflicts that need to be fixed though |
50d484c
to
b0cf4c5
Compare
Thanks @farhanreynaldo |
Add moments and tests for the below distributions as part of #5078: