def test_dynamic_evidence(self): """Test numerical results for nested sampling with dynamic_goal=0.""" dynamic_goal = 0 dyPolyChord.run_dypolychord( self.run_func, dynamic_goal, self.settings, init_step=self.ninit, ninit=self.ninit) run = nestcheck.data_processing.process_polychord_run( self.settings['file_root'], self.settings['base_dir']) first_logl = -158.773632799691 if not np.isclose(run['logl'][0], first_logl): warnings.warn( self.random_seed_msg.format(run['logl'][0], first_logl), UserWarning) else: self.assertEqual(e.count_samples(run), 1169) self.assertAlmostEqual(e.param_mean(run), 0.026487985350451874, places=12)
def test_dynamic_both_evidence_and_param(self): """Test numerical results for nested sampling with dynamic_goal=0.25.""" dynamic_goal = 0.25 dyPolyChord.run_dypolychord( self.run_func, dynamic_goal, self.settings, init_step=self.ninit, ninit=self.ninit) run = nestcheck.data_processing.process_polychord_run( self.settings['file_root'], self.settings['base_dir']) first_logl = -165.502617578541 if not np.isclose(run['logl'][0], first_logl): warnings.warn( self.random_seed_msg.format(run['logl'][0], first_logl), UserWarning) else: self.assertEqual(e.count_samples(run), 1093) self.assertAlmostEqual(e.param_mean(run), -0.0021307716191374263, places=12)
def test_count_samples(self): """Check count_samples estimator.""" self.assertEqual(e.count_samples(self.ns_run), self.nsamples)