-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Implement icdf for Univariate distribution #6528
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
Implement icdf for Univariate distribution #6528
Conversation
@ricardoV94 if that's what you had in mind I can continue adding them for other distributions, I wanted to create a PR before writing a lot to make sure we're on the same page |
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 like a good start! Some issues mentioned in the comments below
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 good, left some comments below and don't miss the test :)
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6528 +/- ##
=======================================
Coverage 92.01% 92.01%
=======================================
Files 93 93
Lines 15737 15742 +5
=======================================
+ Hits 14480 14485 +5
Misses 1257 1257
|
@ricardoV94 I've included tests in previous commits, following the lead from test_normal_icdf. Please take a look at it, as I might have missed something |
…ed Truncated Normal
Oh sorry I must have missed it, I was looking only at the last commit |
I assume that I still need to add params like lower and upper for distribution tests that require them. I'm just not quite sure if it's possible to include conditional arguments in @pytest.mark.parametrize, or I should create another set of test parameters (try to group them up, so they can share the same test datasets) |
Each row in the parametrize should include one set of parameters that are jointly valid to test the icdf. Adding 2 or 3 rows should be enough. |
I also tried to play with the idea of adding a new if-else to numpy_res assignment, in which I could maybe alter what goes to it: |
For the compatibility between PyMC and Scipy parametrizations you can wrap scipy icdf in a lambda function that does the parameter conversion (untested code and parametrization expression): test_fn=lambda value, lower, upper: stats.uniform.icdf(value, lower, upper-lower) |
@ricardoV94 , I've adjusted the uniform icdf to use the new value and parameter checks for icdf, I think we should merge it now so It can be used as a template for contributors with further icdf implementations |
@michaelraczycki the code still includes the untested icdf for the truncated normal, and it's using the old testing routine, not the new |
….py check_icdf with skip_paradomain_outside_edge_test param
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 good. Should be squashed merged
This reverts commit 473c952.
…#6528)"" This reverts commit 86f36031759620a124ba5b46faf9305d2b160b71.
What is this PR about?
Adding icdf functions for existing distributions
Creation of tests for added idcf functions
Major / Breaking Changes
New features
Bugfixes
Documentation
Maintenance