The NestedSampling package

[Tags:gpl, library]

Nested Sampling is a numerical algorithm for approximate Bayesian inference. It generates samples from the posterior distribution but its main purpose is to estimate the evidence P(M|D) of the model conditioned on the observed data. More information on Nested Sampling is available at

The original code can be found at along with documentation at An example program called lighthouse.hs is included.

So far, only the simple demonstration file called mininest.c has been ported. There is a more sophisticated C library available at but it has not been ported to Haskell yet.

[Skip to Readme]


Versions 0.1.1, 0.1.2, 0.1.3, 0.1.4
Dependencies base (==4.*), random, vector [details]
License GPL-2
Copyright (C) Sivia, Skilling 2006, Trotts 2011
Author Issac Trotts
Stability Unknown
Category Statistics
Home page
Source repository head: git clone git://
Uploaded Thu Sep 22 07:24:27 UTC 2011 by IssacTrotts
Distributions NixOS:0.1.4
Downloads 1091 total (5 in the last 30 days)
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]




Maintainer's Corner

For package maintainers and hackage trustees

Readme for NestedSampling

Readme for NestedSampling-0.1.4

The code here is a fairly straightforward translation of the tutorial
nested sampling code from Skilling and Sivia. The translation was
done by Issac Trotts starting in June 2011.

What follows is an adaptation of the original README:

This directory holds little toy nested-sampling programs
in Haskell, adapted from the C code in the update of Devinder's book "Data
Analysis: a Bayesian Tutorial" (2nd edition) OUP 2006.

To get started, install Haskell (GHC), then run
$ cabal install

Try out the example program like this:

$ lighthouse 
logZ: -160.48 +- 0.17
information: 2.90 nats
1000 samples

x = 1.25 +- 0.18
y = 1.00 +- 0.20

Details can be found at the top of lighthouse.hs.