Skip to content
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

New common test framework for distributions #31

Merged
merged 51 commits into from
Oct 7, 2021

Conversation

aherbert
Copy link
Contributor

Another update to the base distribution test. This one uses properties files to contain distribution test data.

@aherbert aherbert force-pushed the dist-test2 branch 11 times, most recently from bce5221 to 3a30e4b Compare October 1, 2021 10:05
@aherbert aherbert force-pushed the dist-test2 branch 7 times, most recently from 460e998 to 686b01f Compare October 4, 2021 17:47
Resource files are used to store test cases for parameterizations of a distribution.

Updated base test class for Nakagami, binomial and Poisson distributions.
Capture limitation of normal distribution inverse CDF. This test fails and is currently disabled.
Added exceptions when parameters are not strictly positive.

Do not raise an exception for x=0 or x=1 when alpha or beta<1 and return
the limit.

Add special cases for x=0 and x=1 when alpha or beta = 1.
Required an updated value for the Euler-Mascheroni constant to compute
the mean.
Add a framework for creating assertions using absolute, relative, or ULP
distances.

Add a custom assertEquals method with formatted error message containing
the tolerance.
This replaces JUnit absolute tolerance assertions with a more
configurable tolerance.

Added missing cases for CDF(lower) and CDF(upper) in the consistency
test.

Fix geometric distribution CDF to handle edge case of integer max value.
This renames the previous tolerance to absolute tolerance.

The relative tolerance is combined with the absolute tolerance using an
Or operation. With no changes to the absolute tolerane all tests still
pass.
This clarifies the usage and difference with equals().

Add combinations and symmetry test for the DoubleTolerance instances.
Disable absolute tolerance in the base distribution test.
The absolute values were often limited by the inverse CDF mapping test
returning x-points that have a magnitude far above the probability range
of [0, 1]. In these cases the inverse mapping is limited by the relative
accuracy of the default implementation (1e-9).

Relative accuracy in most cases which use the default inverse CDF
function can be set at 1e-9.

Many tests pass the relative accuracy default of 1e-12.

Some tests required explicit survival function values since 1-CDF is
inaccurate as CDF -> 1.

Use 1 ULP tolerance for some high precision additional tests.
Recomputed all reference values.
The default for the high precision relative tolerance is fine for these
tests.
Add extreme test for geometric distribution

Use double addition to avoid overflow
Add test with a large range.

Add a survival function.
This requires a flag to disable the PMF sum test. The CDF and PMF do not
match for the range at integer max value.
@asfgit asfgit merged commit 795c530 into apache:master Oct 7, 2021
@aherbert aherbert changed the title Dist test2 New common test framework for distributions Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants