def test_dd_data_prob(): ss = dd.create_ss() hp = dd.create_hp() assert_almost_equal(dd.data_prob(hp, ss), 0) dd.add_data(ss, 0) assert_almost_equal(dd.data_prob(hp, ss), log(0.5))
def test_dd_sample_post(): ss = dd.create_ss() hp = dd.create_hp() dd.sample_post(hp, ss)
def test_dd_sample_data(): ss = dd.create_ss() hp = dd.create_hp() dd.sample_data(hp, ss)
def test_dd_pred_prob(): ss = dd.create_ss() hp = dd.create_hp() assert_almost_equal(dd.pred_prob(hp, ss, 0), log(0.5)) assert_almost_equal(dd.pred_prob(hp, ss, 1), log(0.5))
def test_dd_create_hp(): hp = dd.create_hp() assert len(hp.alphas) == 2