flat-mcmc: Painless general-purpose sampling.

[ library, math, mit ] [ Propose Tags ] [ Report a vulnerability ]

flat-mcmc is a Haskell library for painless, efficient, general-purpose sampling from continuous distributions.

flat-mcmc uses an ensemble sampler that is invariant to affine transformations of space. It wanders a target probability distribution's parameter space as if it had been "flattened" or "unstretched" in some sense, allowing many particles to explore it locally and in parallel.

In general this sampler is useful when you want decent performance without dealing with any tuning parameters or local proposal distributions.

flat-mcmc exports an mcmc function that prints a trace to stdout, as well as a flat transition operator that can be used more generally.

import Numeric.MCMC.Flat
import Data.Vector (Vector, toList, fromList)

rosenbrock :: Vector Double -> Double
rosenbrock xs = negate (5  *(x1 - x0 ^ 2) ^ 2 + 0.05 * (1 - x0) ^ 2) where
  [x0, x1] = toList xs

ensemble :: Ensemble
ensemble = fromList [
    fromList [negate 1.0, negate 1.0]
  , fromList [negate 1.0, 1.0]
  , fromList [1.0, negate 1.0]
  , fromList [1.0, 1.0]
  ]

main :: IO ()
main = withSystemRandom . asGenIO $ mcmc 12500 ensemble rosenbrock

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 1.0.0, 1.0.1, 1.1.1, 1.2.1, 1.2.2, 1.3.0, 1.4.0, 1.4.1, 1.4.2, 1.5.0, 1.5.1, 1.5.2
Dependencies base (>4 && <6), mcmc-types (>=1.0.1 && <2), monad-par (>=0.3.4.7 && <1), monad-par-extras (>=0.3.3 && <1), mwc-probability (>=1.0.1 && <2), pipes (>4 && <5), primitive, transformers, vector [details]
License MIT
Author Jared Tobin
Maintainer jared@jtobin.ca
Category Math
Home page http://jtobin.github.com/flat-mcmc
Source repo head: git clone http://github.com/jtobin/flat-mcmc.git
Uploaded by JaredTobin at 2016-10-28T01:19:31Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 8590 total (23 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-10-29 [all 1 reports]