Skip to content

TST: stats: bump test tolerance in TestMultivariateNormal.test_broadcasting #7712

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

Merged
merged 1 commit into from
Aug 8, 2017

Conversation

pv
Copy link
Member

@pv pv commented Aug 7, 2017

The multivariate computations use a randomized algorithm, so the outputs
vary. The test with the previous tolerance appears to fail on all
platforms if iterated several times -- and also failed on windows on the
first round. Bump the tolerance to a value where the failures become
less likely.

This test has failed sporadically on Travis and Appveyor several times now,
and should be fixed asap.

@asnelt: ping

@@ -216,7 +216,7 @@ def test_broadcasting(self):
# Repeat for cdf
actual = multivariate_normal.cdf(X[i, j], mean, cov)
desired = multivariate_normal.cdf(X, mean, cov)[i, j]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small optimization
AFAICS desired arrays only need to be computed once outside of the loop.

As a broadcasting test it might only need some "nice" x, in case there are values that are difficult to compute or have tiny cdf values.

Copy link
Member Author

@pv pv Aug 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if such nice x exists (and won't be doing the work to find it for this PR) --- the computation appears to use a randomized algorithm.

…asting

The multivariate computations use a randomized algorithm, so the outputs
vary. The test with the previous tolerance appears to fail on all
platforms if iterated several times -- and also failed on windows on the
first round. Bump the tolerance to a value where the failures become
less likely.

Also move comparison values out from the loop.
@pv pv mentioned this pull request Aug 7, 2017
@ev-br ev-br merged commit 38e24c4 into scipy:master Aug 8, 2017
@ev-br ev-br added this to the 1.0 milestone Aug 8, 2017
@ev-br ev-br added maintenance Items related to regular maintenance tasks scipy.stats labels Aug 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Items related to regular maintenance tasks scipy.stats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants