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: Mon Nov 16 11:13:01 2020.
Synopsis
- newtype AnalysisName = AnalysisName {}
- data BurnInSpecification
- burnInIterations :: BurnInSpecification -> Int
- newtype Iterations = Iterations {}
- data ExecutionMode
- openWithExecutionMode :: ExecutionMode -> FilePath -> IO Handle
- data ParallelizationMode
- data SaveMode
- data Verbosity
- data Settings = Settings {}
- settingsSave :: Settings -> IO ()
- settingsLoad :: AnalysisName -> IO Settings
- settingsCheck :: Settings -> Int -> IO ()
Data types
newtype AnalysisName Source #
Analysis name of the MCMC sampler.
Instances
Eq AnalysisName Source # | |
Defined in Mcmc.Settings (==) :: AnalysisName -> AnalysisName -> Bool # (/=) :: AnalysisName -> AnalysisName -> Bool # | |
Read AnalysisName Source # | |
Defined in Mcmc.Settings readsPrec :: Int -> ReadS AnalysisName # readList :: ReadS [AnalysisName] # | |
Show AnalysisName Source # | |
Defined in Mcmc.Settings showsPrec :: Int -> AnalysisName -> ShowS # show :: AnalysisName -> String # showList :: [AnalysisName] -> ShowS # | |
ToJSON AnalysisName Source # | |
Defined in Mcmc.Settings toJSON :: AnalysisName -> Value # toEncoding :: AnalysisName -> Encoding # toJSONList :: [AnalysisName] -> Value # toEncodingList :: [AnalysisName] -> Encoding # | |
FromJSON AnalysisName Source # | |
Defined in Mcmc.Settings parseJSON :: Value -> Parser AnalysisName # parseJSONList :: Value -> Parser [AnalysisName] # |
data BurnInSpecification Source #
Burn in specification.
NoBurnIn | No burn in. |
BurnInWithoutAutoTuning Int | Burn in for a given number of iterations. |
BurnInWithAutoTuning Int Int | Burn in for a given number of iterations. Enable auto tuning with a given period. |
Instances
Eq BurnInSpecification Source # | |
Defined in Mcmc.Settings (==) :: BurnInSpecification -> BurnInSpecification -> Bool # (/=) :: BurnInSpecification -> BurnInSpecification -> Bool # | |
Read BurnInSpecification Source # | |
Defined in Mcmc.Settings | |
Show BurnInSpecification Source # | |
Defined in Mcmc.Settings showsPrec :: Int -> BurnInSpecification -> ShowS # show :: BurnInSpecification -> String # showList :: [BurnInSpecification] -> ShowS # | |
ToJSON BurnInSpecification Source # | |
Defined in Mcmc.Settings toJSON :: BurnInSpecification -> Value # toEncoding :: BurnInSpecification -> Encoding # toJSONList :: [BurnInSpecification] -> Value # toEncodingList :: [BurnInSpecification] -> Encoding # | |
FromJSON BurnInSpecification Source # | |
Defined in Mcmc.Settings parseJSON :: Value -> Parser BurnInSpecification # parseJSONList :: Value -> Parser [BurnInSpecification] # |
burnInIterations :: BurnInSpecification -> Int Source #
Get the number of burn in iterations.
newtype Iterations Source #
Number of normal iterations after burn in.
Note that auto tuning only happens during burn in.
Instances
Eq Iterations Source # | |
Defined in Mcmc.Settings (==) :: Iterations -> Iterations -> Bool # (/=) :: Iterations -> Iterations -> Bool # | |
Read Iterations Source # | |
Defined in Mcmc.Settings readsPrec :: Int -> ReadS Iterations # readList :: ReadS [Iterations] # readPrec :: ReadPrec Iterations # readListPrec :: ReadPrec [Iterations] # | |
Show Iterations Source # | |
Defined in Mcmc.Settings showsPrec :: Int -> Iterations -> ShowS # show :: Iterations -> String # showList :: [Iterations] -> ShowS # | |
ToJSON Iterations Source # | |
Defined in Mcmc.Settings toJSON :: Iterations -> Value # toEncoding :: Iterations -> Encoding # toJSONList :: [Iterations] -> Value # toEncodingList :: [Iterations] -> Encoding # | |
FromJSON Iterations Source # | |
Defined in Mcmc.Settings parseJSON :: Value -> Parser Iterations # parseJSONList :: Value -> Parser [Iterations] # |
data ExecutionMode Source #
Execution mode.
Fail | Perform new run. Call |
Overwrite | Perform new run. Overwrite existing output files. |
Continue | Continue a previous run and append to output files. Call |
Instances
Eq ExecutionMode Source # | |
Defined in Mcmc.Settings (==) :: ExecutionMode -> ExecutionMode -> Bool # (/=) :: ExecutionMode -> ExecutionMode -> Bool # | |
Read ExecutionMode Source # | |
Defined in Mcmc.Settings readsPrec :: Int -> ReadS ExecutionMode # readList :: ReadS [ExecutionMode] # | |
Show ExecutionMode Source # | |
Defined in Mcmc.Settings showsPrec :: Int -> ExecutionMode -> ShowS # show :: ExecutionMode -> String # showList :: [ExecutionMode] -> ShowS # | |
ToJSON ExecutionMode Source # | |
Defined in Mcmc.Settings toJSON :: ExecutionMode -> Value # toEncoding :: ExecutionMode -> Encoding # toJSONList :: [ExecutionMode] -> Value # toEncodingList :: [ExecutionMode] -> Encoding # | |
FromJSON ExecutionMode Source # | |
Defined in Mcmc.Settings parseJSON :: Value -> Parser ExecutionMode # parseJSONList :: Value -> Parser [ExecutionMode] # |
openWithExecutionMode :: ExecutionMode -> FilePath -> IO Handle Source #
data ParallelizationMode Source #
Parallelization mode.
Parallel execution of the chains is only beneficial when the algorithm allows for parallelization, and if computation of the next iteration takes a long time. If the calculation of the next state is fast, sequential execution is usually beneficial, even for algorithms involving parallel chains. If the calculation of the next state is slow, parallel execution may be beneficial.
- The Mcmc.Algorithm.Metropolis algorithm is inherently sequential.
- The Mcmc.Algorithm.MC3 algorithm works well with parallelization.
Of course, also the prior or likelihood functions can be computed in parallel. However, this library is not aware of how these functions are computed.
Instances
Eq ParallelizationMode Source # | |
Defined in Mcmc.Settings (==) :: ParallelizationMode -> ParallelizationMode -> Bool # (/=) :: ParallelizationMode -> ParallelizationMode -> Bool # | |
Read ParallelizationMode Source # | |
Defined in Mcmc.Settings | |
Show ParallelizationMode Source # | |
Defined in Mcmc.Settings showsPrec :: Int -> ParallelizationMode -> ShowS # show :: ParallelizationMode -> String # showList :: [ParallelizationMode] -> ShowS # | |
ToJSON ParallelizationMode Source # | |
Defined in Mcmc.Settings toJSON :: ParallelizationMode -> Value # toEncoding :: ParallelizationMode -> Encoding # toJSONList :: [ParallelizationMode] -> Value # toEncodingList :: [ParallelizationMode] -> Encoding # | |
FromJSON ParallelizationMode Source # | |
Defined in Mcmc.Settings parseJSON :: Value -> Parser ParallelizationMode # parseJSONList :: Value -> Parser [ParallelizationMode] # |
Should the MCMC run be saved at the end of the run?
Not much to say here.
Settings
Settings of an MCMC sampler.
settingsSave :: Settings -> IO () Source #
Save settings to a file determined by the analysis name.
settingsLoad :: AnalysisName -> IO Settings Source #
Load settings.
Check settings.
Call error
if:
- The analysis name is the empty string.
- The number of burn in iterations is negative.
- Auto tuning period is zero or negative.
- The number of iterations is negative.
- The current iteration is larger than the total number of iterations.
- The current iteration is non-zero but the execution mode is not
Continue
. - The current iteration is zero but the execution mode is
Continue
.