README.md (1271B)
1 # mighty-metropolis 2 3 [![Build Status](https://secure.travis-ci.org/jtobin/mighty-metropolis.png)](http://travis-ci.org/jtobin/mighty-metropolis) 4 [![Hackage Version](https://img.shields.io/hackage/v/mighty-metropolis.svg)](http://hackage.haskell.org/package/mighty-metropolis) 5 [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jtobin/mighty-metropolis/blob/master/LICENSE) 6 7 The classic Metropolis algorithm. Wander around parameter space according to a 8 simple spherical Gaussian distribution. 9 10 Exports a `mcmc` function that prints a trace to stdout, a `chain` function for 11 collecting results in memory, and a `metropolis` transition operator that can 12 be used more generally. 13 14 See the *test* directory for example usage. 15 16 import Numeric.MCMC.Metropolis 17 18 rosenbrock :: [Double] -> Double 19 rosenbrock [x0, x1] = negate (5 *(x1 - x0 ^ 2) ^ 2 + 0.05 * (1 - x0) ^ 2) 20 21 main :: IO () 22 main = withSystemRandom . asGenIO $ mcmc 10000 1 [0, 0] rosenbrock 23 24 ![trace](https://dl.dropboxusercontent.com/spa/u0s6617yxinm2ca/osecfv_w.png) 25 26 *mighty-metropolis* is a member of the [declarative][decl] suite of libraries, 27 containing a bunch of MCMC algorithms that play nicely together. 28 29 [decl]: https://github.com/jtobin/declarative