packages feed

lazyppl-singlesite-0.2.0: src/LazyPPL/SingleSite.hs

{-| Single-site [Metropolis-Hastings](https://en.wikipedia.org/wiki/Metropolis-Hastings_algorithm).

@mh1 m@ gets out an infinite lazy stream of (result,weight) pairs from the
unnormalized measure @m@, the first of which is the initial draw. At each step
after that, we randomly change one site (a node in the random tree), and then
accept or reject the change. If rejected, we repeat the previous pair.

@mh1@ evaluates each result in full (with @rnf@, hence the @NFData@
constraint) to find the sites that the result depends on. A result must
therefore have a finite normal form. For an infinite result, such as an
infinite list, @mh1@ yields the initial draw and then never yields the next
pair. Use @mh@ from "LazyPPL.Inference.Run" for such models. It has no such
limit, and it is the general-purpose sampler.

Use 'drop' for burn-in and @LazyPPL.every@ for thinning. -}
module LazyPPL.SingleSite (mh1) where

import LazyPPL.SingleSite.Internal (mh1)