| Copyright | (c) Dominik Schrempf 2021 |
|---|---|
| License | GPL-3.0-or-later |
| Maintainer | dominik.schrempf@gmail.com |
| Stability | unstable |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Mcmc.Algorithm
Description
Creation date: Mon Nov 16 14:37:11 2020.
Synopsis
- class Algorithm a where
- aName :: a -> String
- aIteration :: a -> Int
- aIsInValidState :: a -> Bool
- aIterate :: ParallelizationMode -> a -> IO a
- aAutoTune :: Int -> a -> IO a
- aResetAcceptance :: a -> a
- aSummarizeCycle :: a -> ByteString
- aOpenMonitors :: AnalysisName -> ExecutionMode -> a -> IO a
- aExecuteMonitors :: Verbosity -> UTCTime -> Int -> a -> IO (Maybe ByteString)
- aStdMonitorHeader :: a -> ByteString
- aCloseMonitors :: a -> IO a
- aSave :: AnalysisName -> a -> IO ()
Documentation
class Algorithm a where Source #
Class for algorithms used by MCMC samplers.
Methods
Name.
aIteration :: a -> Int Source #
Current iteration.
aIsInValidState :: a -> Bool Source #
Check if the current state is invalid. At the moment this should just check if the posterior probability is zero or NaN.
aIterate :: ParallelizationMode -> a -> IO a Source #
Sample the next state.
aAutoTune :: Int -> a -> IO a Source #
Auto tune all proposals over the last N iterations.
NOTE: Computation in the IO Monad is necessary because the trace is
mutable.
aResetAcceptance :: a -> a Source #
Reset acceptance counts.
aSummarizeCycle :: a -> ByteString Source #
Summarize the cycle.
aOpenMonitors :: AnalysisName -> ExecutionMode -> a -> IO a Source #
Open required monitor files and setup corresponding file handles.
Arguments
| :: Verbosity | |
| -> UTCTime | Starting time. |
| -> Int | Total number of iterations including burn in. |
| -> a | |
| -> IO (Maybe ByteString) |
Execute file monitors and possibly return a monitor string to be written to the standard output and the log file.
aStdMonitorHeader :: a -> ByteString Source #
Header of monitor to standard output.
aCloseMonitors :: a -> IO a Source #
Close monitor files and remove the file handles.
aSave :: AnalysisName -> a -> IO () Source #
Save analysis.