Copyright | (c) Dominik Schrempf 2020 |
---|---|
License | GPL-3.0-or-later |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Creation date: Tue May 5 18:01:15 2020.
Synopsis
- data Cleaner a = Cleaner {
- clEvery :: Int
- clFunction :: a -> a
- data Status a = Status {
- name :: String
- item :: Item a
- iteration :: Int
- trace :: Trace a
- acceptance :: Acceptance (Proposal a)
- burnInIterations :: Maybe Int
- autoTuningPeriod :: Maybe Int
- iterations :: Int
- forceOverwrite :: Bool
- save :: Maybe Int
- verbosity :: Verbosity
- generator :: GenIO
- start :: Maybe (Int, UTCTime)
- logHandle :: Maybe Handle
- priorF :: a -> Log Double
- likelihoodF :: a -> Log Double
- cleaner :: Maybe (Cleaner a)
- cycle :: Cycle a
- monitor :: Monitor a
- status :: String -> (a -> Log Double) -> (a -> Log Double) -> Cycle a -> Monitor a -> a -> Maybe Int -> Maybe Int -> Int -> GenIO -> Status a
- cleanWith :: Cleaner a -> Status a -> Status a
- saveWith :: Int -> Status a -> Status a
- force :: Status a -> Status a
- quiet :: Status a -> Status a
- debug :: Status a -> Status a
- noData :: Status a -> Status a
Documentation
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.
Cleaner | |
|
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.
Status | |
|
:: 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 |
-> Monitor a | A |
-> a | The initial state in the state space |
-> Maybe Int | Number of burn in iterations; deactivate burn in with |
-> Maybe Int | Auto tuning period (only during burn in); deactivate auto tuning with
|
-> 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
.
force :: Status a -> Status a Source #
Overwrite existing files; it is not necessary to use force
, when a chain
is continued.