コード例 #1
0
 def test_generate_combined_chain_non_default_burnin(self):
     pres = setup_pres()
     combined_chain, index = CP.generate_combined_chain_with_index(
         pres=pres, burnin_percentage=0)
     self.assertEqual(combined_chain.shape, (200, 3),
                      msg='Default burnin should yield (200,3) array shape')
     self.assertEqual(len(index), 200, msg='index should have length 100')
     self.assertTrue(
         np.array_equal(combined_chain[0:100, :], pres[0]['chain']))
     self.assertTrue(
         np.array_equal(combined_chain[100:, :], pres[1]['chain']))
コード例 #2
0
 def test_generate_combined_chain(self):
     pres = setup_pres()
     combined_chain, index = CP.generate_combined_chain_with_index(
         pres=pres)
     self.assertEqual(combined_chain.shape, (100, 3),
                      msg='Default burnin should yield (100,3) array shape')
     self.assertEqual(len(index), 100, msg='index should have length 100')
     self.assertTrue(
         np.array_equal(combined_chain[0:50, :], pres[0]['chain'][50:, :]))
     self.assertTrue(
         np.array_equal(combined_chain[50:, :], pres[1]['chain'][50:, :]))