Repository: statsmodels/statsmodels

Issue:
TST: Random failure with Test_MVN_MVT_prob.test_mvn_mvt_3
Example here:

https://travis-ci.org/statsmodels/statsmodels/jobs/447560388

weird thing is, it looks like it passes, but it fails:

```
>       assert_almost_equal(probmvt_R, probmvt, 4)
E       AssertionError: 
E       Arrays are not almost equal to 4 decimals
E        ACTUAL: 0.9522146
E        DESIRED: 0.95226795752678328
```

Seems like its equal to 4 decimals, no? 

Should we just loosen tolerance or change to `assert_allclose`? 

ref #5197 which mentions same failure


Discussion:

Resolving patch:
diff --git a/statsmodels/stats/_lilliefors.py b/statsmodels/stats/_lilliefors.py
--- a/statsmodels/stats/_lilliefors.py
+++ b/statsmodels/stats/_lilliefors.py
@@ -164,9 +164,7 @@ def get_lilliefors_table(dist='norm'):
                                [ 37,  39,  41,  45,  52,  61],
                                [ 25,  26,  28,  30,  35,  42]])[:,::-1] / 1000.
 
-
         # also build a table for larger sample sizes
-
         def f(n):
             return np.array([0.736, 0.768, 0.805, 0.886, 1.031]) / np.sqrt(n)
 


Test patch:
diff --git a/statsmodels/sandbox/distributions/tests/test_multivariate.py b/statsmodels/sandbox/distributions/tests/test_multivariate.py
--- a/statsmodels/sandbox/distributions/tests/test_multivariate.py
+++ b/statsmodels/sandbox/distributions/tests/test_multivariate.py
@@ -3,14 +3,14 @@
 Created on Sat Apr 16 15:02:13 2011
 @author: Josef Perktold
 """
-
 import numpy as np
-from numpy.testing import assert_almost_equal, assert_array_almost_equal
-
+from numpy.testing import (assert_almost_equal, assert_array_almost_equal,
+                           assert_allclose)
 from statsmodels.sandbox.distributions.multivariate import (
                 mvstdtprob, mvstdnormcdf)
 from statsmodels.sandbox.distributions.mv_normal import MVT, MVNormal
 
+
 class Test_MVN_MVT_prob(object):
     #test for block integratal, cdf, of multivariate t and normal
     #comparison results from R
@@ -26,7 +26,6 @@ def setup_class(cls):
         corr2[2,1] = -0.5
         cls.corr2 = corr2
 
-
     def test_mvn_mvt_1(self):
         a, b = self.a, self.b
         df = self.df
@@ -71,9 +70,9 @@ def test_mvn_mvt_3(self):
         probmvt_R = 0.9522146
         quadkwds = {'epsabs': 1e-08}
         probmvt = mvstdtprob(a2, b, corr2, df, quadkwds=quadkwds)
-        assert_almost_equal(probmvt_R, probmvt, 4)
+        assert_allclose(probmvt_R, probmvt, atol=5e-4)
         probmvn = mvstdnormcdf(a2, b, corr2, maxpts=100000, abseps=1e-5)
-        assert_almost_equal(probmvn_R, probmvn, 4)
+        assert_allclose(probmvn_R, probmvn, atol=1e-4)
 
     def test_mvn_mvt_4(self):
         a, bl = self.a, self.b
diff --git a/statsmodels/stats/tests/test_corrpsd.py b/statsmodels/stats/tests/test_corrpsd.py
--- a/statsmodels/stats/tests/test_corrpsd.py
+++ b/statsmodels/stats/tests/test_corrpsd.py
@@ -18,8 +18,6 @@
 
 import warnings
 
-# ignore PendingDeprecationWarning due to matrix conversion in SciPy
-pytestmark = pytest.mark.filterwarnings('ignore:matrix subclass')
 
 def norm_f(x, y):
     '''Frobenious norm (squared sum) of difference between two arrays