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 |
Mcmc.Settings
Contents
Description
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.
Constructors
AnalysisName | |
Fields |
Instances
Eq AnalysisName Source # | |
Defined in Mcmc.Settings | |
Read AnalysisName Source # | |
Defined in Mcmc.Settings Methods readsPrec :: Int -> ReadS AnalysisName # readList :: ReadS [AnalysisName] # | |
Show AnalysisName Source # | |
Defined in Mcmc.Settings Methods showsPrec :: Int -> AnalysisName -> ShowS # show :: AnalysisName -> String # showList :: [AnalysisName] -> ShowS # | |
ToJSON AnalysisName Source # | |
Defined in Mcmc.Settings Methods toJSON :: AnalysisName -> Value # toEncoding :: AnalysisName -> Encoding # toJSONList :: [AnalysisName] -> Value # toEncodingList :: [AnalysisName] -> Encoding # | |
FromJSON AnalysisName Source # | |
Defined in Mcmc.Settings |
data BurnInSpecification Source #
Burn in specification.
Constructors
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 Methods (==) :: BurnInSpecification -> BurnInSpecification -> Bool # (/=) :: BurnInSpecification -> BurnInSpecification -> Bool # | |
Read BurnInSpecification Source # | |
Defined in Mcmc.Settings Methods readsPrec :: Int -> ReadS BurnInSpecification # readList :: ReadS [BurnInSpecification] # | |
Show BurnInSpecification Source # | |
Defined in Mcmc.Settings Methods showsPrec :: Int -> BurnInSpecification -> ShowS # show :: BurnInSpecification -> String # showList :: [BurnInSpecification] -> ShowS # | |
ToJSON BurnInSpecification Source # | |
Defined in Mcmc.Settings Methods toJSON :: BurnInSpecification -> Value # toEncoding :: BurnInSpecification -> Encoding # toJSONList :: [BurnInSpecification] -> Value # toEncodingList :: [BurnInSpecification] -> Encoding # | |
FromJSON BurnInSpecification Source # | |
Defined in Mcmc.Settings Methods 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.
Constructors
Iterations | |
Fields |
Instances
Eq Iterations Source # | |
Defined in Mcmc.Settings | |
Read Iterations Source # | |
Defined in Mcmc.Settings Methods readsPrec :: Int -> ReadS Iterations # readList :: ReadS [Iterations] # readPrec :: ReadPrec Iterations # readListPrec :: ReadPrec [Iterations] # | |
Show Iterations Source # | |
Defined in Mcmc.Settings Methods showsPrec :: Int -> Iterations -> ShowS # show :: Iterations -> String # showList :: [Iterations] -> ShowS # | |
ToJSON Iterations Source # | |
Defined in Mcmc.Settings Methods toJSON :: Iterations -> Value # toEncoding :: Iterations -> Encoding # toJSONList :: [Iterations] -> Value # toEncodingList :: [Iterations] -> Encoding # | |
FromJSON Iterations Source # | |
Defined in Mcmc.Settings |
data ExecutionMode Source #
Execution mode.
Constructors
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 Methods (==) :: ExecutionMode -> ExecutionMode -> Bool # (/=) :: ExecutionMode -> ExecutionMode -> Bool # | |
Read ExecutionMode Source # | |
Defined in Mcmc.Settings Methods readsPrec :: Int -> ReadS ExecutionMode # readList :: ReadS [ExecutionMode] # | |
Show ExecutionMode Source # | |
Defined in Mcmc.Settings Methods showsPrec :: Int -> ExecutionMode -> ShowS # show :: ExecutionMode -> String # showList :: [ExecutionMode] -> ShowS # | |
ToJSON ExecutionMode Source # | |
Defined in Mcmc.Settings Methods toJSON :: ExecutionMode -> Value # toEncoding :: ExecutionMode -> Encoding # toJSONList :: [ExecutionMode] -> Value # toEncodingList :: [ExecutionMode] -> Encoding # | |
FromJSON ExecutionMode Source # | |
Defined in Mcmc.Settings Methods 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.
Constructors
Sequential | |
Parallel |
Instances
Eq ParallelizationMode Source # | |
Defined in Mcmc.Settings Methods (==) :: ParallelizationMode -> ParallelizationMode -> Bool # (/=) :: ParallelizationMode -> ParallelizationMode -> Bool # | |
Read ParallelizationMode Source # | |
Defined in Mcmc.Settings Methods readsPrec :: Int -> ReadS ParallelizationMode # readList :: ReadS [ParallelizationMode] # | |
Show ParallelizationMode Source # | |
Defined in Mcmc.Settings Methods showsPrec :: Int -> ParallelizationMode -> ShowS # show :: ParallelizationMode -> String # showList :: [ParallelizationMode] -> ShowS # | |
ToJSON ParallelizationMode Source # | |
Defined in Mcmc.Settings Methods toJSON :: ParallelizationMode -> Value # toEncoding :: ParallelizationMode -> Encoding # toJSONList :: [ParallelizationMode] -> Value # toEncodingList :: [ParallelizationMode] -> Encoding # | |
FromJSON ParallelizationMode Source # | |
Defined in Mcmc.Settings Methods 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.
Instances
Eq Verbosity Source # | |
Ord Verbosity Source # | |
Read Verbosity Source # | |
Show Verbosity Source # | |
ToJSON Verbosity Source # | |
Defined in Mcmc.Settings | |
FromJSON Verbosity Source # | |
Settings
Settings of an MCMC sampler.
Constructors
Settings | |
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
.