DIY Markov Chains
Log | Files | Refs | README | LICENSE

commit 974c9addab6efc09ca4c16669a17930ff15e779e
parent 551435367c56c11343e0eea4cca2a3135726fec3
Author: Jared Tobin <>
Date:   Fri, 22 May 2020 08:44:05 +0400

Export custom metropolis operator.

mighty-metropolis v2.0.0 adds an argument to the operator that allows
one to use the 'chainTunables' field of a Chain value.  We'll avoid
exporting that functionality here for the time being for the sake of API

Mlib/Numeric/MCMC.hs | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/Numeric/MCMC.hs b/lib/Numeric/MCMC.hs @@ -90,12 +90,11 @@ module Numeric.MCMC ( import Control.Monad (replicateM) import Control.Monad.Codensity (lowerCodensity) -import Control.Monad.IO.Class (MonadIO, liftIO) import Control.Monad.Primitive (PrimMonad, PrimState, RealWorld) import Control.Monad.Trans.State.Strict (execStateT) import Data.Sampling.Types import Numeric.MCMC.Anneal -import Numeric.MCMC.Metropolis (metropolis) +import qualified Numeric.MCMC.Metropolis as M (metropolis) import Numeric.MCMC.Hamiltonian (hamiltonian) import Numeric.MCMC.Slice (slice) import Pipes hiding (next) @@ -206,3 +205,9 @@ drive transition = loop where yield next loop next prng +-- | A generic Metropolis transition operator. +metropolis + :: (Traversable f, PrimMonad m) + => Double + -> Transition m (Chain (f Double) b) +metropolis radial = M.metropolis radial Nothing