| 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.MC3
Description
Creation date: Mon Nov 23 15:20:33 2020.
The Metropolis-coupled Markov chain Monte Carlo (MC3) algorithm.
Also known as parallel tempering.
Like any other parallel MCMC algorithm, the MC3 algorithm is essentially an
MHG algorithm on the product space of all parallel
chains.
For example, see
- Geyer, C. J., Markov chain monte carlo maximum likelihood, Computing Science and Statistics, Proceedings of the 23rd Symposium on the Interface, (1991).
- Altekar, G., Dwarkadas, S., Huelsenbeck, J. P., & Ronquist, F., Parallel metropolis coupled markov chain monte carlo for bayesian phylogenetic inference, Bioinformatics, 20(3), 407–415 (2004).
Synopsis
- newtype NChains = NChains {
- fromNChains :: Int
- newtype SwapPeriod = SwapPeriod {}
- newtype NSwaps = NSwaps {
- fromNSwaps :: Int
- data MC3Settings = MC3Settings {}
- type MHGChains a = Vector (MHG a)
- type ReciprocalTemperatures = Vector Double
- data MC3 a = MC3 {}
- mc3 :: MC3Settings -> Settings -> PriorFunction a -> LikelihoodFunction a -> Cycle a -> Monitor a -> InitialState a -> GenIO -> IO (MC3 a)
- mc3Save :: ToJSON a => AnalysisName -> MC3 a -> IO ()
- mc3Load :: FromJSON a => PriorFunction a -> LikelihoodFunction a -> Cycle a -> Monitor a -> AnalysisName -> IO (MC3 a)
Definitions
Total number of parallel chains.
Must be two or larger.
Constructors
| NChains | |
Fields
| |
newtype SwapPeriod Source #
The period of proposing state swaps between chains.
Must be one or larger.
Constructors
| SwapPeriod | |
Fields | |
Instances
| Eq SwapPeriod Source # | |
Defined in Mcmc.Algorithm.MC3 | |
| Read SwapPeriod Source # | |
Defined in Mcmc.Algorithm.MC3 Methods readsPrec :: Int -> ReadS SwapPeriod # readList :: ReadS [SwapPeriod] # readPrec :: ReadPrec SwapPeriod # readListPrec :: ReadPrec [SwapPeriod] # | |
| Show SwapPeriod Source # | |
Defined in Mcmc.Algorithm.MC3 Methods showsPrec :: Int -> SwapPeriod -> ShowS # show :: SwapPeriod -> String # showList :: [SwapPeriod] -> ShowS # | |
| ToJSON SwapPeriod Source # | |
Defined in Mcmc.Algorithm.MC3 Methods toJSON :: SwapPeriod -> Value # toEncoding :: SwapPeriod -> Encoding # toJSONList :: [SwapPeriod] -> Value # toEncodingList :: [SwapPeriod] -> Encoding # | |
| FromJSON SwapPeriod Source # | |
Defined in Mcmc.Algorithm.MC3 | |
The number of proposed swaps at each swapping event.
Must be in [1, NChains - 1].
Constructors
| NSwaps | |
Fields
| |
data MC3Settings Source #
MC3 settings.
Constructors
| MC3Settings | |
Fields
| |
Instances
| Eq MC3Settings Source # | |
Defined in Mcmc.Algorithm.MC3 | |
| Read MC3Settings Source # | |
Defined in Mcmc.Algorithm.MC3 Methods readsPrec :: Int -> ReadS MC3Settings # readList :: ReadS [MC3Settings] # readPrec :: ReadPrec MC3Settings # readListPrec :: ReadPrec [MC3Settings] # | |
| Show MC3Settings Source # | |
Defined in Mcmc.Algorithm.MC3 Methods showsPrec :: Int -> MC3Settings -> ShowS # show :: MC3Settings -> String # showList :: [MC3Settings] -> ShowS # | |
| ToJSON MC3Settings Source # | |
Defined in Mcmc.Algorithm.MC3 Methods toJSON :: MC3Settings -> Value # toEncoding :: MC3Settings -> Encoding # toJSONList :: [MC3Settings] -> Value # toEncodingList :: [MC3Settings] -> Encoding # | |
| FromJSON MC3Settings Source # | |
Defined in Mcmc.Algorithm.MC3 | |
type ReciprocalTemperatures = Vector Double Source #
Vector of reciprocal temperatures.
Metropolis-coupled Markov chain Monte Carlo algorithm
The MC3 algorithm.
Constructors
| MC3 | |
Fields
| |
Instances
| ToJSON a => Algorithm (MC3 a) Source # | |
Defined in Mcmc.Algorithm.MC3 Methods aName :: MC3 a -> String Source # aIteration :: MC3 a -> Int Source # aIsInValidState :: MC3 a -> Bool Source # aIterate :: ParallelizationMode -> MC3 a -> IO (MC3 a) Source # aAutoTune :: Int -> MC3 a -> IO (MC3 a) Source # aResetAcceptance :: MC3 a -> MC3 a Source # aSummarizeCycle :: MC3 a -> ByteString Source # aOpenMonitors :: AnalysisName -> ExecutionMode -> MC3 a -> IO (MC3 a) Source # aExecuteMonitors :: Verbosity -> UTCTime -> Int -> MC3 a -> IO (Maybe ByteString) Source # aStdMonitorHeader :: MC3 a -> ByteString Source # | |
mc3 :: MC3Settings -> Settings -> PriorFunction a -> LikelihoodFunction a -> Cycle a -> Monitor a -> InitialState a -> GenIO -> IO (MC3 a) Source #
Initialize an MC3 algorithm with a given number of chains.
Call error if:
- The number of chains is one or lower.
- The swap period is zero or negative.
mc3Load :: FromJSON a => PriorFunction a -> LikelihoodFunction a -> Cycle a -> Monitor a -> AnalysisName -> IO (MC3 a) Source #
Load an MC3 algorithm.
See mcmcContinue.