コード例 #1
0
ファイル: test_funcs.py プロジェクト: zkurtz/astropy
def test_fpp_kuiper_two(N, M):
    with NumpyRNGContext(12345):
        R = 100
        fpp = 0.05
        fps = 0
        for i in range(R):
            D, f = funcs.kuiper_two(np.random.random(N), np.random.random(M))
            if f < fpp:
                fps += 1
        assert scipy.stats.binom(R, fpp).sf(fps - 1) > 0.005
        assert scipy.stats.binom(R, fpp).cdf(fps - 1) > 0.005
コード例 #2
0
ファイル: test_funcs.py プロジェクト: Cadair/astropy
def test_fpp_kuiper_two(N, M):
    with NumpyRNGContext(12345):
        R = 100
        fpp = 0.05
        fps = 0
        for i in range(R):
            D, f = funcs.kuiper_two(np.random.random(N), np.random.random(M))
            if f < fpp:
                fps += 1
        assert scipy.stats.binom(R, fpp).sf(fps - 1) > 0.005
        assert scipy.stats.binom(R, fpp).cdf(fps - 1) > 0.005
コード例 #3
0
ファイル: test_funcs.py プロジェクト: zkurtz/astropy
def test_detect_kuiper_two_different():
    with NumpyRNGContext(12345):
        D, f = funcs.kuiper_two(
            np.random.random(500) * 0.5, np.random.random(500))
        assert f < 0.01
コード例 #4
0
ファイル: test_funcs.py プロジェクト: zkurtz/astropy
def test_kuiper_two_nonuniform(N, M):
    with NumpyRNGContext(12345):
        assert funcs.kuiper_two(
            np.random.random(N)**2,
            np.random.random(M)**2)[1] > 0.01
コード例 #5
0
ファイル: test_funcs.py プロジェクト: Cadair/astropy
def test_detect_kuiper_two_different():
    with NumpyRNGContext(12345):
        D, f = funcs.kuiper_two(np.random.random(500) * 0.5,
                                np.random.random(500))
        assert f < 0.01
コード例 #6
0
ファイル: test_funcs.py プロジェクト: Cadair/astropy
def test_kuiper_two_nonuniform(N, M):
    with NumpyRNGContext(12345):
        assert funcs.kuiper_two(np.random.random(N)**2,
                                np.random.random(M)**2)[1] > 0.01