mcmc-types-1.0.3: Common types for sampling.

Copyright(c) 2015 Jared Tobin
LicenseMIT
MaintainerJared Tobin <jared@jtobin.ca>
Stabilityunstable
Portabilityghc
Safe HaskellNone
LanguageHaskell2010

Data.Sampling.Types

Description

Common types for implementing Markov Chain Monte Carlo (MCMC) algorithms.

Target is a product type intended to hold a log-target density function and potentially its gradient.

The Chain type represents a kind of annotated parameter space. Technically all that's required here is the type of the parameter space itself (held here in chainPosition) but in practice some additional information is typically useful. Additionally there is chainScore for holding the most recent score of the chain, as well as the target itself for implementing things like annealing. The chainTunables field can be used to hold arbitrary data.

One should avoid exploiting these features to do something nasty (like, say, invalidating the Markov property).

The Transition type permits probabilistic transitions over some state space by way of the underlying Prob monad.

Synopsis

Documentation

type Transition m a = StateT a (Prob m) () Source #

A generic transition operator.

Has access to randomness via the underlying Prob monad.

data Chain a b Source #

The Chain type specifies the state of a Markov chain at any given iteration.

Constructors

Chain 

Instances

Show a => Show (Chain a b) Source # 

Methods

showsPrec :: Int -> Chain a b -> ShowS #

show :: Chain a b -> String #

showList :: [Chain a b] -> ShowS #

data Target a Source #

A Target consists of a function from parameter space to the reals, as well as possibly a gradient.

Most implementations assume a log-target, so records are named accordingly.

Constructors

Target 

Fields