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

Refactored testing for univariate distributions #291

Merged
merged 29 commits into from
Nov 1, 2014
Merged

Refactored testing for univariate distributions #291

merged 29 commits into from
Nov 1, 2014

Conversation

lindahua
Copy link
Contributor

@lindahua lindahua commented Nov 1, 2014

This PR implements the following, with an aim to improve the testing of univariate distributions:

  1. add testutils.jl to src, which provides a test_distr function that performs a thorough checking of the validity and consistency of implemented methods for a distribution type. Particularly, this function checks the support, pdf, cdf, quantile, stats functions, sampling functions, and see whether their behaviours are consistent with each other. (see the function body for details). This function can be applied to new distributions, thus making it easier for contributors to ensure that their implementations are correct.
  2. The test files are now based on test_distr.
  3. I generate "ground-truth values" for many distributions provided by the package, by computing those values using scipy.stats, and write those values to csv files. Every time the tests are being run, they will load the ground-truth values from the csv files (also committed), and check whether the Julia functions yield the same values (tiny deviations are tolerable).
  4. I find a few places where the original implementations are not accurate or incorrect, and fix those.

I believe the univariate distributions are now more reliable.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.74%) when pulling 8a9404a on dh/rtests into 4699002 on master.

lindahua added a commit that referenced this pull request Nov 1, 2014
Refactored testing for univariate distributions
@lindahua lindahua merged commit 7dda741 into master Nov 1, 2014
@ararslan ararslan deleted the dh/rtests branch September 29, 2016 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants