JuliaStats/Distributions.jl — pull request #291 by lindahua (2014-11-01 09:43:08+00:00)
Title: Refactored testing for univariate distributions

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.