Пример #1
0
def test_ci():
    # isolated test of CI functions
    arr = np.linspace(0, 1, 1000)[..., np.newaxis]
    assert_allclose(_ci(arr, method="parametric"),
                    _ci(arr, method="bootstrap"), rtol=.005)
    assert_allclose(_bootstrap_ci(arr, statfun="median", random_state=0),
                    _bootstrap_ci(arr, statfun="mean", random_state=0),
                    rtol=.1)
Пример #2
0
def test_ci():
    """Test confidence intervals."""
    # isolated test of CI functions
    arr = np.linspace(0, 1, 1000)[..., np.newaxis]
    assert_allclose(_ci(arr, method="parametric"),
                    _ci(arr, method="bootstrap"),
                    rtol=.005)
    assert_allclose(_bootstrap_ci(arr, stat_fun="median", random_state=0),
                    _bootstrap_ci(arr, stat_fun="mean", random_state=0),
                    rtol=.1)
    # smoke test for new API
    if check_version('numpy', '1.17'):
        random_state = np.random.default_rng(0)
        _bootstrap_ci(arr, random_state=random_state)