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
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
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
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
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