Bayesian inference in Python
Python Shell
Pull request Compare This branch is 1868 commits behind pymc-devs:master.
Latest commit 53aff99 Oct 12, 2014 @kyleam kyleam Fix docstring typo
Failed to load latest commit information.

PyMC 3

![Gitter]( Chat.svg)

Build Status

PyMC is a python module for Bayesian statistical modeling and model fitting which focuses on advanced Markov chain Monte Carlo fitting algorithms. Its flexibility and extensibility make it applicable to a large suite of problems.

Check out the Tutorial!

PyMC 3 is alpha software and is not ready for use in production. We encourage most new users to use the current release version in the PyMC 2.3 branch. Release versions are also available on PyPI and Binstar.


  • Intuitive model specification syntax, for example, x ~ N(0,1) translates to x = Normal(0,1)
  • Powerful sampling algorithms such as Hamiltonian Monte Carlo
  • Easy optimization for finding the maximum a posteriori point
  • Theano features
  • Numpy broadcasting and advanced indexing
  • Linear algebra operators
  • Computation optimization and dynamic C compilation
  • Simple extensibility

Getting started


The latest version of PyMC 3 can be installed from the master branch using pip:

pip install git+

Another option is to clone the repository and install PyMC using python install or python develop.

Note: Running pip install pymc will install PyMC 2.3, not PyMC 3, from PyPI.


PyMC is tested on Python 2.7 and 3.3 and depends on Theano, NumPy, SciPy, and Matplotlib (see for version information).


The GLM submodule relies on Pandas, Patsy, Statsmodels.

scikits.sparse enables sparse scaling matrices which are useful for large problems. Installation on Ubuntu is easy:

sudo apt-get install libsuitesparse-dev
pip install git+

On Mac OS X you can install libsuitesparse 4.2.1 via homebrew (see to install homebrew), manually add a link so the include files are where scikits-sparse expects them, and then install scikits-sparse:

brew install suite-sparse
ln -s /usr/local/Cellar/suite-sparse/4.2.1/include/ /usr/local/include/suitesparse
pip install git+


Apache License, Version 2.0