Pythonic Bayesian inference and visualization for the MultiNest Nested Sampling Algorithm and PyCuba's cubature algorithms.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
doc updated doc version [skip ci] Nov 27, 2017
pycuba Allow for ctypes-based callbacks. Apr 27, 2016
pymultinest allow silent analyser Nov 27, 2017
pypolychord Working prototype for a PolyChord interface Jun 12, 2015
tests apparently Python3 does not have has_key Nov 27, 2017
.coveragerc added CI Nov 27, 2017
.gitignore Support for Python3 and partial support of MultiNest v3.0 with INS Jul 3, 2013
.travis.yml add cuba demo to travis Nov 27, 2017
COPYING added GPLv3 license Jan 5, 2012
INSTALL added pycuba doc; referring to tutorial; improved install doc Dec 2, 2013
LICENSE added MultiNest license exception Dec 1, 2013
README.rst updated feature overview [skip ci] Nov 27, 2017
conda-requirements.txt added CI Nov 27, 2017 added model comparison script Apr 20, 2017 updated README + multinest_marginals gives instructions for parameter… Nov 27, 2017 fixed Python3 has_key pycuba demo issue Nov 27, 2017 removed apemost, improved documentation, version 2.5 Nov 27, 2017 recommending new more pythonic API in demo scripts Apr 20, 2017 recommending new more pythonic API in demo scripts Apr 20, 2017 implemented storage in temp directory if outputfiles_basename not given Jan 28, 2015 Fixes issue #55 (os.path.mkdir -> os.mkdir) Jun 12, 2015
setup.cfg allowing binary wheel distribution [skip ci] Nov 27, 2017 allow silent analyser Nov 27, 2017


PyMultiNest -- Python interface for MultiNest

This library provides programmatic access to MultiNest and PyCuba.

What is MultiNest?

MultiNest is a program and a sampling technique. As a Bayesian inference technique, it allows parameter estimation and model selection. (find out more in the MultiNest paper,, or in a classic MCMC sampler, ). Recently, MultiNest added Importance Nested Sampling (INS, see which is now also supported.

The efficient Monte Carlo algorithm for sampling the parameter space is based on nested sampling and the idea of disjoint multi-dimensional ellipse sampling.

For the scientific community, where Python is becoming the new lingua franca (luckily), I provide an interface to MultiNest.

The automatic build makes sure both Python 2.7 and Python 3 are working correctly with MultiNest and Cuba. It also tests that MultiNest works with MPI enabled.

What does PyMultiNest do?


  • provides an easy-to-use interface to MultiNest and Cuba integration algorithms
  • allows connecting with your existing scientific Python code (numpy, scipy)
  • allows Prior & LogLikelihood functions written in Python.
  • Easy plotting, visualization and summary of MultiNest results.
  • Running MultiNest with MPI

The plotting can also be run on existing MultiNest output, and when not using PyMultiNest for running MultiNest.

Citing PyMultiNest


Questions and Problems

For any questions or problems with the software, please open an issue. This helps other people google the same question.

Using MultiNest with Python?

Look at the documentation available at

What is PyCuba?

Cuba (, is a multidimensional numerical integration library for low dimensions. PyCuba allows integration of Python functions, providing an advanced alternative to the basic functions provided in scipy.integrate.

In the Bayesian sense, it is possible to use Cuba for model selection.

Q: Python callback functions are too slow!

If you really identified that your callback functions are too slow, even when using the usual tricks (numpy, etc.), you can implement and compile them as C functions.

You still have the neat python interface (default parameters, etc.), but achieve full execution speed, as only native code is executed while MultiNest runs.