Source code: https://github.com/js850/nested_sampling
Documentation: http://js850.github.io/nested_sampling
Flexible and efficient Python implementation of the nested sampling algorithm. This implementation is geared towards allowing statistical physicists to use this method for thermodynamic analysis but is also being used by astrophysicists.
This implementation uses the language of statistical mechanics (partition function, phase space, configurations, energy, density of states) rather than the language of Bayesian sampling (likelihood, prior, evidence). This is simply for convenience, the method is the same.
The package goes beyond the bare implementation of the method providing:
Figure 1: Snapshot of a Nested Sampling iteration on a multimodal surface. Each contour line corresponds to a past maximum energy (log-likelihood) constraint. The inner most contour line corresponds to the current constraint and the corresponding sample is removed (crossed in red) and replaced by walking a copy of a randomly selected replica (walk trajectory is the dashed line and the red point is the new configuration that satisfies the tighter constraint). The bottom panel shows the fraction of phase space corresponding to each sample and the iterative contractions (corresponding to the contours) are shown by the horizontal lines. Note that the nested sampling contraction of phase space is constant in the log of phase space volume. The full animation can be run from the example folder.
nested sampling has been authored by Stefano Martiniani Jacob D. Stevenson at the University of Cambridge. The project is publicly available under the GNU general public licence.