lwMCMC

A parameter space sampling class for lightweight Bayesian inference. Running on a NumPy-based implementation of the Metropolis-Hastings algorithm.


Keywords
bayesian-inference, machine-learning, statistical-modeling, numpy, python3, probabilistic-programming, mcmc, pymc3, markov-chain-monte-carlo, posterior-probability, probabilistic-inference, hamiltonian-dynamics, metropolis-hastings-algorithm, prior-weighting
License
MIT
Install
pip install lwMCMC==1.0

Documentation

Build Status

lwMCMC: lightweight Markov Chain Monte Carlo


from lwMCMC import MCMC

Parameter space sampling with MCMC. See Bayesian inference with the MCMC class below, for an Experimental Geophysics regression.

Posterior distributions MCMC model fit
  • The grid entries reveal the 1-dimensional posterior distributions of our parameters after setting our prior beliefs, as well as the pairwise projections with one and two sigma error contours.

  • With the slope parameters's 1.8 +- 0.225 prior, the Bayesian inferred slope is 1.70 +- 0.17.


Package Layout

  • LICENSE - the MIT license, which applies to this package
  • README.md - the README file, which you are now reading
  • requirements.txt - prerequisites to install this package, used by pip
  • setup.py - installer script
  • docs/ - contains documentation on package installation and usage
  • examples/ - use cases for Bayesian Modeling
  • lwMCMC/ - the library code itself
  • tests/ - unit tests