eggplantbren / NestedSampling.hs

Classic Nested Sampling in Haskell.
MIT License
6 stars 3 forks source link

NestedSampling.hs

MIT License

(c) 2016 Brendon J. Brewer and Jared Tobin

This is a Haskell implementation of the classic Nested Sampling algorithm introduced by John Skilling. You can use it for Bayesian inference, statistical mechanics, and optimisation applications.

There are a few examples included that you can run using Stack as follows:

$ stack test NestedSampling-hs:test:spikeslab
$ stack test NestedSampling-hs:test:rosenbrock

.. and so on. Check the .cabal file for a list of examples, the code for which can always be found in the test directory.

Running any of these examples will log sampling progress to stdout and also dump output information to a couple of CSV files:

You can then run a Python postprocessing script to generate some plots, and a text file of posterior weights:

$ python showresults.py

This script requires NumPy, Matplotlib, and Pandas.