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

Fix the test_sampling.py test failures #28

Merged
merged 1 commit into from
Feb 24, 2021
Merged

Fix the test_sampling.py test failures #28

merged 1 commit into from
Feb 24, 2021

Conversation

mjlarson
Copy link
Contributor

The test_sampling.py relied on numbers found from the buggy InvCDF sampling before the fix in #19 . This updates the test with new numbers and replaces a hand-crafted truncated gaussian distribution in the test with an implementation from scipy, which directly gives the cdf values we want to test against.

In order to better ensure that things are working correctly, adding is also added to the InvCDF function. This ensures that the values at the edges - CDF values of 0 and 1 - return the right thing. Before, the edges were a little bit dodgy and could return values outside of [0,1].

…e robust. It still relies on magic numbers from 'I ran it one time and got these', but that's to be expected when testing a sampler.
@itaboada itaboada merged commit 6e2ae1b into base Feb 24, 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
Development

Successfully merging this pull request may close these issues.

2 participants