declarative: DIY Markov Chains.

[ library, math, mit ] [ Propose Tags ]

This package presents a simple combinator language for Markov transition operators that are useful in MCMC.

Any transition operators sharing the same stationary distribution and obeying the Markov and reversibility properties can be combined in a couple of ways, such that the resulting operator preserves the stationary distribution and desirable properties amenable for MCMC.

We can deterministically concatenate operators end-to-end, or sample from a collection of them according to some probability distribution. See Geyer, 2005 for details.

A useful strategy is to hedge one's 'sampling risk' by occasionally interleaving a computationally-expensive transition (such as a gradient-based algorithm like Hamiltonian Monte Carlo or NUTS) with cheap Metropolis transitions.

transition = frequency [
    (9, metropolis 1.0)
  , (1, hamiltonian 0.05 20)
  ]

Alternatively: sample consecutively using the same algorithm, but over a range of different proposal distributions.

transition = concatAllT [
    slice 0.5
  , slice 1.0
  , slice 2.0
  ]

Or just mix and match and see what happens!

transition =
  sampleT
    (sampleT (metropolis 0.5) (slice 0.1))
    (sampleT (hamiltonian 0.01 20) (metropolis 2.0))

Check the test suite for example usage.

Versions [faq] 0.1.0.0, 0.1.0.1, 0.2.1, 0.2.2, 0.2.3, 0.3.3, 0.3.4, 0.4.0, 0.5.0, 0.5.1, 0.5.2
Dependencies base (>=4 && <6), hasty-hamiltonian (>=1.1.1), kan-extensions (==5.*), lens (==4.*), mcmc-types (>=1.0.1), mighty-metropolis (>=1.0.1), mwc-probability (>=1.0.1), pipes (==4.*), primitive (>=0.6 && <1.0), speedy-slice (>=0.1.2), transformers (>=0.5 && <1.0) [details]
License MIT
Author Jared Tobin
Maintainer jared@jtobin.ca
Category Math
Home page http://github.com/jtobin/declarative
Source repo head: git clone http://github.com/jtobin/declarative.git
Uploaded by JaredTobin at Wed Dec 21 21:15:22 UTC 2016
Distributions LTSHaskell:0.5.2, NixOS:0.5.2, Stackage:0.5.2
Downloads 3454 total (214 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
All reported builds failed as of 2016-12-22 [all 3 reports]

Modules

  • Numeric
    • Numeric.MCMC
      • Numeric.MCMC.Anneal

Downloads

Maintainer's Corner

For package maintainers and hackage trustees