Copyright | 2021 Dominik Schrempf |
---|---|
License | GPL-3.0-or-later |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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 -> StdGen -> 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.
newtype SwapPeriod Source #
The period of proposing state swaps between chains.
Must be one or larger.
Instances
FromJSON SwapPeriod Source # | |
Defined in Mcmc.Algorithm.MC3 parseJSON :: Value -> Parser SwapPeriod # parseJSONList :: Value -> Parser [SwapPeriod] # | |
ToJSON SwapPeriod Source # | |
Defined in Mcmc.Algorithm.MC3 toJSON :: SwapPeriod -> Value # toEncoding :: SwapPeriod -> Encoding # toJSONList :: [SwapPeriod] -> Value # toEncodingList :: [SwapPeriod] -> Encoding # omitField :: SwapPeriod -> Bool # | |
Read SwapPeriod Source # | |
Defined in Mcmc.Algorithm.MC3 readsPrec :: Int -> ReadS SwapPeriod # readList :: ReadS [SwapPeriod] # readPrec :: ReadPrec SwapPeriod # readListPrec :: ReadPrec [SwapPeriod] # | |
Show SwapPeriod Source # | |
Defined in Mcmc.Algorithm.MC3 showsPrec :: Int -> SwapPeriod -> ShowS # show :: SwapPeriod -> String # showList :: [SwapPeriod] -> ShowS # | |
Eq SwapPeriod Source # | |
Defined in Mcmc.Algorithm.MC3 (==) :: SwapPeriod -> SwapPeriod -> Bool # (/=) :: SwapPeriod -> SwapPeriod -> Bool # |
The number of proposed swaps at each swapping event.
Must be in [1, NChains - 1]
.
NSwaps | |
|
data MC3Settings Source #
MC3 settings.
MC3Settings | |
|
Instances
FromJSON MC3Settings Source # | |
Defined in Mcmc.Algorithm.MC3 parseJSON :: Value -> Parser MC3Settings # parseJSONList :: Value -> Parser [MC3Settings] # | |
ToJSON MC3Settings Source # | |
Defined in Mcmc.Algorithm.MC3 toJSON :: MC3Settings -> Value # toEncoding :: MC3Settings -> Encoding # toJSONList :: [MC3Settings] -> Value # toEncodingList :: [MC3Settings] -> Encoding # omitField :: MC3Settings -> Bool # | |
Read MC3Settings Source # | |
Defined in Mcmc.Algorithm.MC3 readsPrec :: Int -> ReadS MC3Settings # readList :: ReadS [MC3Settings] # readPrec :: ReadPrec MC3Settings # readListPrec :: ReadPrec [MC3Settings] # | |
Show MC3Settings Source # | |
Defined in Mcmc.Algorithm.MC3 showsPrec :: Int -> MC3Settings -> ShowS # show :: MC3Settings -> String # showList :: [MC3Settings] -> ShowS # | |
Eq MC3Settings Source # | |
Defined in Mcmc.Algorithm.MC3 (==) :: MC3Settings -> MC3Settings -> Bool # (/=) :: MC3Settings -> MC3Settings -> Bool # |
type ReciprocalTemperatures = Vector Double Source #
Vector of reciprocal temperatures.
Metropolis-coupled Markov chain Monte Carlo algorithm
The MC3 algorithm.
MC3 | |
|
Instances
ToJSON a => Algorithm (MC3 a) Source # | |
Defined in Mcmc.Algorithm.MC3 aName :: MC3 a -> String Source # aIteration :: MC3 a -> Int Source # aIsInvalidState :: MC3 a -> Bool Source # aIterate :: IterationMode -> ParallelizationMode -> MC3 a -> IO (MC3 a) Source # aAutoTune :: TuningType -> Int -> MC3 a -> IO (MC3 a) Source # aResetAcceptance :: ResetAcceptance -> MC3 a -> MC3 a Source # aCleanAfterBurnIn :: TraceLength -> MC3 a -> IO (MC3 a) Source # aSummarizeCycle :: IterationMode -> 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 -> StdGen -> 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 #