Exemple #1
0
def test_mean_stddev():
    Hs = []
    for i in range(1000):
        H, M, fpp = htest.h_test(np.random.random(100))
        Hs.append(H)
    print np.mean(Hs), np.std(Hs)
    assert np.abs(np.mean(Hs)-2.51)<0.1
    assert np.abs(np.std(Hs)-2.51)<0.3
Exemple #2
0
def test_mean_stddev():
    Hs = []
    for i in range(1000):
        H, M, fpp = htest.h_test(np.random.random(100))
        Hs.append(H)
    print np.mean(Hs), np.std(Hs)
    assert np.abs(np.mean(Hs) - 2.51) < 0.1
    assert np.abs(np.std(Hs) - 2.51) < 0.3
Exemple #3
0
def F(x):
    return htest.h_test(x)[2]
Exemple #4
0
def test_compare_zm2():
    data = np.random.random(1000)
    H, M, fpp = htest.h_test(data)
    Z, zm2fpp = zm2.zm2(data, M)
    assert np.abs(Z - (H+4*M-4))<1e-8
    assert fpp>zm2fpp
Exemple #5
0
def test_non_null():
    H, M, fpp = htest.h_test(np.random.random(1000)/2)
    assert fpp<0.01
Exemple #6
0
def F(x):
    return htest.h_test(x)[2]
Exemple #7
0
def test_compare_zm2():
    data = np.random.random(1000)
    H, M, fpp = htest.h_test(data)
    Z, zm2fpp = zm2.zm2(data, M)
    assert np.abs(Z - (H + 4 * M - 4)) < 1e-8
    assert fpp > zm2fpp
Exemple #8
0
def test_non_null():
    H, M, fpp = htest.h_test(np.random.random(1000) / 2)
    assert fpp < 0.01