How to use the emcee.autocorr.integrated_time function in emcee

To help you get started, we’ve selected a few emcee examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dfm / emcee / tests / unit / test_autocorr.py View on Github external
def test_autocorr_multi_works():
    np.random.seed(42)
    xs = np.random.randn(16384, 2)

    # This throws exception unconditionally in buggy impl's
    acls_multi = integrated_time(xs)
    acls_single = np.array([integrated_time(xs[:, i])
                            for i in range(xs.shape[1])])

    assert np.all(np.abs(acls_multi - acls_single) < 2)
github dfm / emcee / tests / unit / test_autocorr.py View on Github external
def test_nd(seed=1234, ndim=3, N=150000):
    x = get_chain(seed=seed, ndim=ndim, N=N)
    tau = integrated_time(x)
    assert np.all(np.abs(tau - 19.0) / 19. < 0.2)
github dfm / emcee / tests / unit / test_autocorr.py View on Github external
def test_too_short(seed=1234, ndim=3, N=100):
    x = get_chain(seed=seed, ndim=ndim, N=N)
    with pytest.raises(AutocorrError):
        integrated_time(x)
    tau = integrated_time(x, quiet=True)  # NOQA
github dfm / emcee / tests / unit / test_autocorr.py View on Github external
def test_autocorr_multi_works():
    np.random.seed(42)
    xs = np.random.randn(16384, 2)

    # This throws exception unconditionally in buggy impl's
    acls_multi = integrated_time(xs)
    acls_single = np.array([integrated_time(xs[:, i])
                            for i in range(xs.shape[1])])

    assert np.all(np.abs(acls_multi - acls_single) < 2)