Skip to main content

zeus: Lightning Fast MCMC

Project description

logo

zeus is a Python implementation of the Ensemble Slice Sampling method.

  • Fast & Robust Bayesian Inference,
  • Efficient Markov Chain Monte Carlo (MCMC),
  • Black-box inference, no hand-tuning,
  • Excellent performance in terms of autocorrelation time and convergence rate,
  • Scale to multiple CPUs without any extra effort.

GitHub arXiv arXiv ascl Build Status License: GPL v3 Documentation Status Downloads

Example

For instance, if you wanted to draw samples from a 10-dimensional Gaussian, you would do something like:

import zeus
import numpy as np

def log_prob(x, ivar):
    return - 0.5 * np.sum(ivar * x**2.0)

nsteps, nwalkers, ndim = 1000, 100, 10
ivar = 1.0 / np.random.rand(ndim)
start = np.random.randn(nwalkers,ndim)

sampler = zeus.EnsembleSampler(nwalkers, ndim, log_prob, args=[ivar])
sampler.run_mcmc(start, nsteps)
chain = sampler.get_chain(flat=True)

Documentation

Read the docs at zeus-mcmc.readthedocs.io

Installation

To install zeus using pip run:

pip install zeus-mcmc

To install zeus in a [Ana]Conda environment use:

conda install -c conda-forge zeus-mcmc

Attribution

Please cite the following papers if you found this code useful in your research:

@article{karamanis2021zeus,
  title={zeus: A Python implementation of Ensemble Slice Sampling for efficient Bayesian parameter inference},
  author={Karamanis, Minas and Beutler, Florian and Peacock, John A},
  journal={arXiv preprint arXiv:2105.03468},
  year={2021}
}

@article{karamanis2020ensemble,
    title = {Ensemble slice sampling: Parallel, black-box and gradient-free inference for correlated & multimodal distributions},
    author = {Karamanis, Minas and Beutler, Florian},
    journal = {arXiv preprint arXiv: 2002.06212},
    year = {2020}
}

Licence

Copyright 2019-2021 Minas Karamanis and contributors.

zeus is free software made available under the GPL-3.0 License. For details see the LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zeus-mcmc-2.3.1.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

zeus_mcmc-2.3.1-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

Details for the file zeus-mcmc-2.3.1.tar.gz.

File metadata

  • Download URL: zeus-mcmc-2.3.1.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.10

File hashes

Hashes for zeus-mcmc-2.3.1.tar.gz
Algorithm Hash digest
SHA256 0259f00207a93eb041cab70384602d1526ac65e63873053729f04d7dd72df69c
MD5 5169611412799cda16a525e99cf471cf
BLAKE2b-256 3575ab1094e2cca01464aa26e35099899c8a034d19e58b527b3a8ba12767b686

See more details on using hashes here.

File details

Details for the file zeus_mcmc-2.3.1-py3-none-any.whl.

File metadata

  • Download URL: zeus_mcmc-2.3.1-py3-none-any.whl
  • Upload date:
  • Size: 33.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.10

File hashes

Hashes for zeus_mcmc-2.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e12b4f65c68e947a625ad9c45547dfab24de09feea70474be38a2bad16b47c60
MD5 244d86c2897b859c4c3add8aafcb143e
BLAKE2b-256 4bfbab097bed737e60a6a9aba392829228509c9584a7759d18b6fe5f60014a1b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page