How to use the emcee.moves 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 / integration / test_nuts.py View on Github external
@pytest.mark.parametrize("metric", [None, IdentityMetric(3),
                                    IsotropicMetric(3),
                                    DiagonalMetric(np.ones(3)),
                                    DenseMetric(np.eye(3))])
@pytest.mark.parametrize("pool", [True, False])
@pytest.mark.parametrize("tune", [True, False])
@pytest.mark.parametrize("blobs", [True, False])
def test_normal_nuts(pool, metric, tune, blobs, **kwargs):
    if pool:
        kwargs["pool"] = Pool()
    if tune:
        move = moves.NoUTurnMove(ntune=300)
    else:
        move = moves.NoUTurnMove()
    kwargs["ndim"] = 3
    kwargs["check_acceptance"] = False
    kwargs["nsteps"] = 100
    kwargs["blobs"] = blobs
    _test_normal(move, **kwargs)
    if pool:
        kwargs["pool"].close()
github dfm / emcee / tests / integration / test_nuts.py View on Github external
@pytest.mark.parametrize("metric", [None, IdentityMetric(3),
                                    IsotropicMetric(3),
                                    DiagonalMetric(np.ones(3)),
                                    DenseMetric(np.eye(3))])
@pytest.mark.parametrize("pool", [True, False])
@pytest.mark.parametrize("tune", [True, False])
@pytest.mark.parametrize("blobs", [True, False])
def test_normal_nuts(pool, metric, tune, blobs, **kwargs):
    if pool:
        kwargs["pool"] = Pool()
    if tune:
        move = moves.NoUTurnMove(ntune=300)
    else:
        move = moves.NoUTurnMove()
    kwargs["ndim"] = 3
    kwargs["check_acceptance"] = False
    kwargs["nsteps"] = 100
    kwargs["blobs"] = blobs
    _test_normal(move, **kwargs)
    if pool:
        kwargs["pool"].close()
github dfm / emcee / tests / integration / test_de.py View on Github external
def test_normal_de_no_gamma(**kwargs):
    _test_normal(moves.DEMove(1e-2, 1e-2), **kwargs)
github dfm / emcee / tests / integration / test_hmc.py View on Github external
def test_normal_hmc(pool, metric, tune, blobs, **kwargs):
    if pool:
        kwargs["pool"] = Pool()
    if tune:
        move = moves.HamiltonianMove(10, ntune=300, parallel_safe=pool)
    else:
        move = moves.HamiltonianMove(10, parallel_safe=pool)
    kwargs["ndim"] = 3
    kwargs["check_acceptance"] = False
    kwargs["nsteps"] = 100
    kwargs["blobs"] = blobs
    _test_normal(move, **kwargs)
    if pool:
        kwargs["pool"].close()
github dfm / emcee / tests / integration / test_de.py View on Github external
def test_normal_de(**kwargs):
    _test_normal(moves.DEMove(1e-2), **kwargs)
github dfm / emcee / tests / integration / test_hmc.py View on Github external
def test_normal_hmc(pool, metric, tune, blobs, **kwargs):
    if pool:
        kwargs["pool"] = Pool()
    if tune:
        move = moves.HamiltonianMove(10, ntune=300, parallel_safe=pool)
    else:
        move = moves.HamiltonianMove(10, parallel_safe=pool)
    kwargs["ndim"] = 3
    kwargs["check_acceptance"] = False
    kwargs["nsteps"] = 100
    kwargs["blobs"] = blobs
    _test_normal(move, **kwargs)
    if pool:
        kwargs["pool"].close()