Repository navigation
Conversation
The BinomialTest is updated to use a tolerance of 1e-15 when testing if p(i) <= p(k). This avoids small ULP errors when probabilities should be equal causing the observation i to be missed from the p-value sum. The binomial distribution probability is very accurate so a small tolerance can be used. The FisherExactTest is updated to use a 1e-14 tolerance for the hypergeometric distribution probabilities. This probability is a sum of 3 binomial log probabilities with cancellation. The UnconditionedExactTest is updated to use the same 1e-14 tolerance when computing Fisher p-values. A tolerance is also used when comparing the Fisher p-values in Boschloo's test. The computation of Z values in the UnconditionedExactTest has been updated to reduce rounding errors. A ULP tolerance is used when comparing Z values.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #141 +/- ##
============================================
+ Coverage 99.62% 99.70% +0.08%
+ Complexity 2441 672 -1769
============================================
Files 116 122 +6
Lines 6087 6779 +692
Branches 951 1035 +84
============================================
+ Hits 6064 6759 +695
+ Misses 10 6 -4
- Partials 13 14 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Tolerances may not be required. Further investigation is in progress to determine if cases can be found that still fail after accuracy has been improved in the binomial and hypergeometric distributions. Closing for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The BinomialTest is updated to use a tolerance of 1e-15 when testing if p(i) <= p(k). This avoids small ULP errors when probabilities should be equal causing the observation i to be missed from the p-value sum. The binomial distribution probability is very accurate so a small tolerance can be used.
The FisherExactTest is updated to use a 1e-14 tolerance for the hypergeometric distribution probabilities. This probability is a sum of 3 binomial log probabilities with cancellation.
The UnconditionedExactTest is updated to use the same 1e-14 tolerance when computing Fisher p-values. A tolerance is also used when comparing the Fisher p-values in Boschloo's test.
The computation of Z values in the UnconditionedExactTest has been updated to reduce rounding errors. A ULP tolerance is used when comparing Z values.