mcmc-0.3.0: Sample from a posterior using Markov chain Monte Carlo
Copyright(c) Dominik Schrempf 2020
LicenseGPL-3.0-or-later
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Mcmc.Status

Description

Creation date: Tue May 5 18:01:15 2020.

Synopsis

Documentation

data Cleaner a Source #

Clean the state periodically.

The prior and the likelihood will be updated after the cleaning process.

For long chains, successive numerical errors can accumulate such that the state diverges from honoring specific required constraints. In these cases, a Cleaner can be used to ensure that the required constraints of the state are honored. For example, the branches of an ultrametric phylogeny may diverge slightly after successful many proposals such that the phylogeny is not anymore ultrametric.

Please be aware that the Markov chain will not converge to the true posterior distribution if the state is changed substantially! Only apply subtle changes that are absolutely necessary to preserve the required properties of the state such as specific numerical constraints.

Constructors

Cleaner 

Fields

  • clEvery :: Int

    Clean every given number of iterations.

  • clFunction :: a -> a

    Cleaning function. Executed before monitoring the state.

data Status a Source #

The Status contains all information to run an MCMC chain. It is constructed using the function status.

The polymorphic type a stores the state of the chain. It can also be used to store auxiliary information.

Constructors

Status 

Fields

status Source #

Arguments

:: String

Name of the Markov chain; used as file prefix.

-> (a -> Log Double)

The prior function.

-> (a -> Log Double)

The likelihood function.

-> Cycle a

A list of Proposals executed in forward order. The chain will be logged after each cycle.

-> Monitor a

A Monitor observing the chain.

-> a

The initial state in the state space a.

-> Maybe Int

Number of burn in iterations; deactivate burn in with Nothing.

-> Maybe Int

Auto tuning period (only during burn in); deactivate auto tuning with Nothing.

-> Int

Number of normal iterations excluding burn in. Note that auto tuning only happens during burn in.

-> GenIO

A source of randomness. For reproducible runs, make sure to use generators with the same, fixed seed.

-> Status a 

Initialize the Status of a Markov chain Monte Carlo run.

cleanWith :: Cleaner a -> Status a -> Status a Source #

Clean the state every given number of generations using the given function. See Cleaner.

saveWith :: Int -> Status a -> Status a Source #

Save the Markov chain with trace of given length.

force :: Status a -> Status a Source #

Overwrite existing files; it is not necessary to use force, when a chain is continued.

quiet :: Status a -> Status a Source #

Do not print anything to standard output. Do not create log file. File monitors and batch monitors are executed normally.

debug :: Status a -> Status a Source #

Be verbose.

noData :: Status a -> Status a Source #

Set the likelihood function to 1.0. Useful for debugging and testing.