-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Adding Interpolated moment #5222
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
Codecov Report
@@ Coverage Diff @@
## main #5222 +/- ##
=======================================
Coverage 78.98% 78.98%
=======================================
Files 88 88
Lines 14231 14236 +5
=======================================
+ Hits 11240 11245 +5
Misses 2991 2991
|
8fd404a
to
1d5f73d
Compare
@larryshamalama Can you try to rebase your PR on the latest version of main to see if the tests pass now that #5067 was merged? |
I will do this today! |
1d5f73d
to
9bb46c3
Compare
Seems like you are giving invalid values for the spline algorithm that is used inside the Interpolated: https://github.com/pymc-devs/pymc/runs/4374823157?check_suite_focus=true#step:7:742 |
I fixed the increasing However, I am encountering another issue. I don't have full understanding of the
Reference: https://github.com/pymc-devs/pymc/blob/main/pymc/distributions/continuous.py#L3687 |
For conveniente the interpolated RV actually uses 3 variables, x, pdf, cdf, but we create the last for the user in Anyway the get_moment should expect those 3 in the signature even if it doesn't make use of them. |
9bb46c3
to
d337afa
Compare
[ | ||
(np.array([-1, 1]), np.array([0.4, 0.6]), None, 0.2), | ||
(np.array([-4, -1, 3, 9, 19]), np.array([0.1 , 0.15, 0.2 , 0.25, 0.3 ]), None, 8), | ||
# (np.array([-22, -4, 0, 8, 13]), np.tile(1 / 5, 5), (5, 3), -np.ones((5, 3))), |
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 result
from the moment test is always 1.54589372 despite their dot product being 8. Any thoughts on why I am getting the same, constant error? This may be related to the error that I am encountering in StickBreakingWeights
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.
Solved, the answer to this is that Interpolated
"connects" the Z
.
2008118
to
b5d1a82
Compare
09d8874
to
07feaf6
Compare
Given that the pdf is normalized, we do not need that |
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.
Looks great, thanks @larryshamalama
Co-authored-by: Ricardo Vieira <[email protected]>
Thanks to you @ricardoV94 for all your help as always |
This PR adds moment and a test for
pm.Interpolated
(see issue #5078). However, this PR requires issue #5048 to be addressed first (see corresponding WIP PR #5067).Currently, the tests yield the following error:
This PR serves as a placeholder to track my progress.