-
Notifications
You must be signed in to change notification settings - Fork 143
Extend support of RandomVariable
s in JAX backend
#200
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
) | ||
assert test_res.pvalue > 0.1 | ||
assert not np.isnan(test_res.statistic) | ||
assert test_res.pvalue > 0.01 |
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 old criteria was a bit too loose. With two tests per RV it had a 81% under the null hypothesis
8853a41
to
ad3b16a
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #200 +/- ##
==========================================
+ Coverage 79.95% 80.06% +0.11%
==========================================
Files 170 170
Lines 44856 45185 +329
Branches 9498 9608 +110
==========================================
+ Hits 35863 36176 +313
- Misses 6780 6794 +14
- Partials 2213 2215 +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.
LGTM, but don't trust my judgment on these distribution rewrites that I'm unfamiliar with:
- GeometricRV
- NegBinomialRV
- ChiSquaredRV
- GenGammaRV
- WaldRV
- BetaBinomialRV
Fair enough. Those are just straightforward equivalences one can find on Wikipedia / direct translations from the Scipy and Numpy implementations. The samples are tested against the scipy CDF for the continuous distributions and I tested the first two moments (meand and std) of the discrete distributions against the moment references found on Wikipedia |
RandomVariable
s in JAX backend
This PR extends the number of RandomVariables supported in the JAX backend, with two strategies:
The rewrites from 1. may be reused with other backends later (e.g, Numba). This seems like a cleaner solution than implementing the same logic in the different dispatched functions of each backend.