pymcmcstat

docs build coverage license zenodo joss pypi pyversion

The pymcmcstat package is a Python program for running Markov Chain Monte Carlo (MCMC) simulations. Included in this package is the ability to use different Metropolis based sampling techniques:

  • Metropolis-Hastings (MH): Primary sampling method.

  • Adaptive-Metropolis (AM): Adapts covariance matrix at specified intervals.

  • Delayed-Rejection (DR): Delays rejection by sampling from a narrower distribution. Capable of n-stage delayed rejection.

  • Delayed Rejection Adaptive Metropolis (DRAM): DR + AM

This package is an adaptation of the MATLAB toolbox mcmcstat. The user interface is designed to be as similar to the MATLAB version as possible, but this implementation has taken advantage of certain data structure concepts more amenable to Python.

Note, advanced plotting routines are available in the mcmcplot package. Many plotting features are directly available within pymcmcstat, but some user’s may find mcmcplot useful.

Installation

This code can be found on the Github project page. This package is available on the PyPI distribution site and the latest version can be installed via

pip install pymcmcstat

The master branch on Github typically matches the latest version on the PyPI distribution site. To install the master branch directly from Github,

pip install git+https://github.com/prmiles/pymcmcstat.git

You can also clone the repository and run python  setup.py install.

License

MIT

Contributors

See the GitHub contributor page

Citing pymcmcstat

Miles, (2019). pymcmcstat: A Python Package for Bayesian Inference Using Delayed Rejection Adaptive Metropolis. Journal of Open Source Software, 4(38), 1417, https://doi.org/10.21105/joss.01417

Also, please cite the appropriate Zenodo archive for the version of pymcmcstat that you are using.

References

BG98

Stephen P Brooks and Andrew Gelman. General methods for monitoring convergence of iterative simulations. Journal of computational and graphical statistics, 7(4):434–455, 1998.

BR98

Stephen P Brooks and Gareth O Roberts. Assessing convergence of markov chain monte carlo algorithms. Statistics and Computing, 8(4):319–335, 1998. URL: http://www.math.pitt.edu/~swigon/Homework/brooks97assessing.pdf.

GR+92

Andrew Gelman, Donald B Rubin, and others. Inference from iterative simulation using multiple sequences. Statistical science, 7(4):457–472, 1992.

HLMS06

Heikki Haario, Marko Laine, Antonietta Mira, and Eero Saksman. Dram: efficient adaptive mcmc. Statistics and Computing, 16(4):339–354, 2006. URL: https://link.springer.com/article/10.1007/s11222-006-9438-0.

HST+01

Heikki Haario, Eero Saksman, Johanna Tamminen, and others. An adaptive metropolis algorithm. Bernoulli, 7(2):223–242, 2001. URL: https://projecteuclid.org/euclid.bj/1080222083.

MT00

George Marsaglia and Wai Wan Tsang. A simple method for generating gamma variables. ACM Transactions on Mathematical Software (TOMS), 26(3):363–372, 2000. URL: https://dl.acm.org/citation.cfm?id=358414.

Smi14

Ralph C. Smith. Uncertainty quantification: theory, implementation, and applications. Volume 12. SIAM, 2014.

Indices and tables