Skip to content

Commit

Permalink
Reduced number of failures in MatrixNormal tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kc611 committed Jun 23, 2021
1 parent 684f338 commit 44aeb54
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pymc3/tests/test_distributions_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ class TestMatrixNormal(BaseTestDistribution):

def test_matrix_normal(self):
delta = 0.05 # limit for KS p-value
n_fails = 100 # Allows the KS fails a certain number of times
n_fails = 10 # Allows the KS fails a certain number of times
size = (100,)

def ref_rand(size, mu, rowcov, colcov):
Expand All @@ -1374,12 +1374,14 @@ def ref_rand(size, mu, rowcov, colcov):
matrixnormal_smp = check["mvnormal"][f - 1, :, :]
curr_ref_smp = ref_smp[f - 1, :, :]

p = min(
st.ks_2samp(
np.atleast_1d(matrixnormal_smp[..., idx]).flatten(),
np.atleast_1d(curr_ref_smp[..., idx]).flatten(),
)[1]
for idx in range(matrixnormal_smp.shape[-1])
p = np.mean(
[
st.ks_2samp(
np.atleast_1d(matrixnormal_smp[..., idx]).flatten(),
np.atleast_1d(curr_ref_smp[..., idx]).flatten(),
)[1]
for idx in range(matrixnormal_smp.shape[-1])
]
)
f -= 1

Expand Down

0 comments on commit 44aeb54

Please sign in to comment.