From 5e156e7be4a5ed04767c66033394d25962c6f764 Mon Sep 17 00:00:00 2001 From: Chris Fonnesbeck Date: Tue, 17 Jan 2017 21:08:03 -0600 Subject: [PATCH] Restored test_bad; changed testvals of test case --- pymc3/tests/test_diagnostics.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pymc3/tests/test_diagnostics.py b/pymc3/tests/test_diagnostics.py index f8d91ea287..83800b1c61 100644 --- a/pymc3/tests/test_diagnostics.py +++ b/pymc3/tests/test_diagnostics.py @@ -21,7 +21,6 @@ def get_ptrace(self, n_samples): step1 = Slice([model.early_mean_log_, model.late_mean_log_]) step2 = Metropolis([model.switchpoint]) start = {'early_mean': 7., 'late_mean': 1., 'switchpoint': 90} - ptrace = sample(n_samples, step=[step1, step2], start=start, njobs=2, progressbar=False, random_seed=[1, 4]) return ptrace @@ -33,12 +32,12 @@ def test_good(self): self.assertTrue(all(1 / self.good_ratio < r < self.good_ratio for r in rhat.values())) - # def test_bad(self): - # """Confirm Gelman-Rubin statistic is far from 1 for a small number of samples.""" - # n_samples = 10 - # rhat = gelman_rubin(self.get_ptrace(n_samples)) - # self.assertFalse(all(1 / self.good_ratio < r < - # self.good_ratio for r in rhat.values())) + def test_bad(self): + """Confirm Gelman-Rubin statistic is far from 1 for a small number of samples.""" + n_samples = 10 + rhat = gelman_rubin(self.get_ptrace(n_samples)) + self.assertFalse(all(1 / self.good_ratio < r < + self.good_ratio for r in rhat.values())) def test_right_shape_python_float(self, shape=None, test_shape=None): """Check Gelman-Rubin statistic shape is correct w/ python float"""