Exemplo n.º 1
0
def test_lladser_ci_series_random():
    seq = "WBWBWBWBWBWB"
    observations = []
    alpha = 0.95
    reps = 1000
    for i in range(reps):
        obs = list(_lladser_ci_series(seq, r=4, alpha=alpha))[0]
        observations.append(obs)
    tps = list(filter(lambda a_b: a_b[0] < 0.5 and 0.5 < a_b[1], observations))
    assert_true(len(tps) >= alpha * reps)  # 100%-95%
Exemplo n.º 2
0
def test_lladser_ci_series_random():
    seq = "WBWBWBWBWBWB"
    observations = []
    alpha = 0.95
    reps = 1000
    for i in range(reps):
        obs = list(_lladser_ci_series(seq, r=4, alpha=alpha))[0]
        observations.append(obs)
    tps = list(filter(lambda a_b: a_b[0] < 0.5 and 0.5 < a_b[1], observations))
    assert_true(len(tps) >= alpha * reps)  # 100%-95%
Exemplo n.º 3
0
def test_lladser_ci_series_exact():
    # have seen RWB
    urn_1 = 'RWBWWBWRRWRYWRPPZ'
    results = list(_lladser_ci_series(urn_1, r=4))
    assert_equal(len(results), 3)
Exemplo n.º 4
0
def test_lladser_ci_series_exact():
    # have seen RWB
    urn_1 = 'RWBWWBWRRWRYWRPPZ'
    results = list(_lladser_ci_series(urn_1, r=4))
    assert_equal(len(results), 3)