Ejemplo n.º 1
0
        def test_sample_results_object_initializes(self):
            s = SamplingResults(self.sampler)

            assert s.samples.shape[0] == self.nwalkers * self.niter
            assert s.acceptance > 0.25
            assert np.isclose(s.L,
                              s.acceptance * self.nwalkers * self.niter)
Ejemplo n.º 2
0
        def test_infer_computes_correct_values(self):
            s = SamplingResults(self.sampler)

            test_mean = 2.00190793
            test_std = 0.00195719
            test_ci = [[1.99435539], [1.9971502]]

            assert np.isclose(test_mean, s.mean[0], atol=0.01, rtol=0.01)
            assert np.isclose(test_std, s.std[0], atol=0.01, rtol=0.01)
            assert np.all(np.isclose(test_ci, s.ci, atol=0.01, rtol=0.01))
Ejemplo n.º 3
0
 def test_infer_computes_correct_values(self):
     s = SamplingResults(self.sampler)
Ejemplo n.º 4
0
        def test_rhat_computes_correct_answer(self):
            s = SamplingResults(self.sampler)

            rhat_test = 3.81886815e-06

            assert np.isclose(rhat_test, s.rhat[0], atol=0.001, rtol=0.001)
Ejemplo n.º 5
0
        def test_sampling_results_acceptance_ratio(self):
            s = SamplingResults(self.sampler)

            assert s.acceptance > 0.25
            assert np.isclose(s.L, s.acceptance * self.nwalkers * self.niter)
Ejemplo n.º 6
0
        def test_sample_results_produces_attributes(self):
            s = SamplingResults(self.sampler)

            assert s.samples.shape[0] == self.nwalkers * self.niter
Ejemplo n.º 7
0
 def test_sample_results_object_initializes(self):
     SamplingResults(self.sampler)