@hackage mighty-metropolis1.0.2
The Metropolis algorithm.
Categories
License
MIT
Maintainer
jared@jtobin.ca
Links
Versions
Installation
Dependencies (6)
- base <5
- mcmc-types >=1.0.1
- mwc-probability >=1.0.1
- pipes >=4 && <5
- primitive
- transformers Show all…
Dependents (1)
@hackage/declarative
The classic Metropolis algorithm.
Wander around parameter space according to a simple spherical Gaussian distribution.
Exports a mcmc function that prints a trace to stdout, as well as a
metropolis transition operator that can be used more generally.
import Numeric.MCMC.Metropolis rosenbrock :: [Double] -> Double rosenbrock [x0, x1] = negate (5 *(x1 - x0 ^ 2) ^ 2 + 0.05 * (1 - x0) ^ 2) main :: IO () main = withSystemRandom . asGenIO $ mcmc 10000 1 [0, 0] rosenbrock