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

Testing of distributions #357

Open
Tracked by #1432
pitdicker opened this issue Mar 30, 2018 · 8 comments
Open
Tracked by #1432

Testing of distributions #357

pitdicker opened this issue Mar 30, 2018 · 8 comments

Comments

@pitdicker
Copy link
Contributor

We should add some testing for distributions. Unfortunately since distribution samples are random, this is inherently difficult. Original issue dhardy#72.

See for some direction rust-lang/rust#10084, and the random-tests.

@vks
Copy link
Collaborator

vks commented Mar 30, 2018

Also see #290.

@dhardy
Copy link
Member

dhardy commented Aug 4, 2018

@vks has some plans for histogram-based testing, though possibly only after PDFs are added.

Separately, we should add some tests of value-stability.

@vks
Copy link
Collaborator

vks commented Aug 4, 2018

@vks has some plans for histogram-based testing, though possibly only after PDFs are added.

See tests/uniformity.rs, which could be generalized to arbitrary distributions (with given PDFs).

@dhardy dhardy mentioned this issue Jan 28, 2019
22 tasks
@dhardy dhardy mentioned this issue May 14, 2019
2 tasks
@dhardy
Copy link
Member

dhardy commented Nov 6, 2019

@vks could I interest you (or potentially someone else) in adding at utility to rand_distr (perhaps an example) which plots histograms of each distribution from actual samples (not PDFs)? This would at least let us eye-ball that distributions are doing roughly the right thing.

@vks
Copy link
Collaborator

vks commented Nov 6, 2019

I was thinking about using sparklines for that. I'm interested, but I can't make promises that I'll get to it before the end of the year.

@vks
Copy link
Collaborator

vks commented May 15, 2021

Resolving this issue was started in #1121, more work is needed to extend it to the other distributions.

@vks
Copy link
Collaborator

vks commented Apr 26, 2024

I think we should either make this issue more actionable or close it.

For which distributions do we want histogram tests? Sometimes, calculating the PDF is non-trivial and requires special functions.

@dhardy
Copy link
Member

dhardy commented Apr 27, 2024

I suggest the following approach:

  1. Pick a representative parameter set (or possibly a small number of parametrisations).
  2. Generate a histogram with this parametrisation and manually verify that the result looks reasonable.
  3. Potentially lower the number of buckets and samples used by the histogram, and check the result is still similar. (We want tests to be reasonably fast to run.)
  4. The test should enforce exact reproduction of this histogram.

This should allow fast and robust testing (within the limits of reproducibility), with the caveat that any value-breaking change must again be visually confirmed.

It should be applicable to all distributions, though may be hard to visualise for multi-dimensional outputs.

It cannot confirm perfect accuracy, especially in degenerate cases.

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

No branches or pull requests

3 participants