mcmc: Sample from a posterior using Markov chain Monte Carlo

[ gpl, library, math, statistics ] [ Propose Tags ]

Please see the README on GitHub at

[Skip to Readme]


  • Mcmc
    • Mcmc.Acceptance
    • Mcmc.Algorithm
      • Mcmc.Algorithm.MC3
      • Mcmc.Algorithm.MHG
    • Chain
      • Mcmc.Chain.Chain
      • Mcmc.Chain.Link
      • Mcmc.Chain.Save
      • Mcmc.Chain.Trace
    • Mcmc.Cycle
    • Mcmc.Environment
    • Internal
      • Mcmc.Internal.Gamma
    • Mcmc.Likelihood
    • Mcmc.Logger
    • Mcmc.MarginalLikelihood
    • Mcmc.Mcmc
    • Mcmc.Monitor
      • Mcmc.Monitor.Log
      • Mcmc.Monitor.Parameter
      • Mcmc.Monitor.ParameterBatch
      • Mcmc.Monitor.Time
    • Mcmc.Posterior
    • Mcmc.Prior
    • Mcmc.Proposal
      • Mcmc.Proposal.Bactrian
      • Mcmc.Proposal.Generic
      • Mcmc.Proposal.Hamiltonian
      • Mcmc.Proposal.Scale
      • Mcmc.Proposal.Simplex
      • Mcmc.Proposal.Slide
    • Mcmc.Settings
    • Statistics
      • Mcmc.Statistics.Types


Maintainer's Corner

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 0.1.3, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.3.0,,,,,,,,
Change log
Dependencies aeson, base (>=4.7 && <5), bytestring, circular, containers, covariance, data-default, deepseq, directory, dirichlet, double-conversion, hmatrix, log-domain, math-functions, microlens, monad-parallel, mwc-random, pretty-show, primitive, statistics, time, transformers, vector, zlib [details]
License GPL-3.0-or-later
Copyright Dominik Schrempf (2021)
Author Dominik Schrempf
Category Math, Statistics
Home page
Bug tracker
Source repo head: git clone
Uploaded by dschrempf at 2021-09-15T11:52:13Z
Distributions LTSHaskell:, NixOS:, Stackage:
Downloads 1402 total (18 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2021-09-15 [all 2 reports]

Readme for mcmc-

[back to package description]

Markov chain Monte Carlo sampler

Sample from a posterior using Markov chain Monte Carlo (MCMC) algorithms.

At the moment, the following algorithms are available:

  • Metropolis-Hastings-Green 1;
  • Metropolis-coupled Markov chain Monte Carlo (also known as parallel tempering) 2 , 3.
  • Hamilton Monte Carlo proposal 4.


The source code contains detailed documentation about general concepts as well as specific functions.


Example MCMC analyses can be built with cabal-install or Stack and are attached to this repository.

git clone
cd mcmc
stack build

For example, estimate the accuracy of an archer with

stack exec archery

For a more involved example, have a look at the phylogenetic dating project.


1 Geyer, C. J., Introduction to Markov chain Monte Carlo, In Handbook of Markov Chain Monte Carlo (pp. 45) (2011). CRC press.

2 Geyer, C. J., Markov chain monte carlo maximum likelihood, Computing Science and Statistics, Proceedings of the 23rd Symposium on the Interface, (1991).

3 Altekar, G., Dwarkadas, S., Huelsenbeck, J. P., & Ronquist, F., Parallel metropolis coupled markov chain monte carlo for bayesian phylogenetic inference, Bioinformatics, 20(3), 407–415 (2004).

4 Neal, R. M., Mcmc Using Hamiltonian Dynamics, In S. Brooks, A. Gelman, G. Jones, & X. Meng (Eds.), Handbook of Markov Chain Monte Carlo (2011). CRC press.