Copyright | 2021 Dominik Schrempf |
---|---|
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 {}
- class HasAnalysisName s where
- getAnalysisName :: s -> AnalysisName
- data BurnInSettings
- burnInIterations :: BurnInSettings -> Int
- newtype Iterations = Iterations {}
- data TraceLength
- data ExecutionMode
- class HasExecutionMode s where
- getExecutionMode :: s -> ExecutionMode
- openWithExecutionMode :: ExecutionMode -> FilePath -> IO Handle
- data ParallelizationMode
- data SaveMode
- data LogMode
- data Verbosity
- data Settings = Settings {}
- settingsSave :: Settings -> IO ()
- settingsLoad :: AnalysisName -> IO Settings
- settingsCheck :: Settings -> Int -> IO ()
- settingsPrettyPrint :: Settings -> ByteString
Data types
newtype AnalysisName Source #
Analysis name of the MCMC sampler.
Constructors
AnalysisName | |
Fields |
Instances
class HasAnalysisName s where Source #
Types with analysis names.
Methods
getAnalysisName :: s -> AnalysisName Source #
Instances
HasAnalysisName Settings Source # | |
Defined in Mcmc.Settings Methods | |
HasAnalysisName MLSettings Source # | |
Defined in Mcmc.MarginalLikelihood Methods |
data BurnInSettings 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. |
BurnInWithCustomAutoTuning [Int] [Int] | Burn in with the given list of fast and full auto tuning periods. The list of fast auto tuning periods may be empty. All periods have to be strictly positive. See also For example, Usually it is useful to auto tune more frequently in the beginning of the MCMC run. |
Instances
Eq BurnInSettings Source # | |
Defined in Mcmc.Settings Methods (==) :: BurnInSettings -> BurnInSettings -> Bool # (/=) :: BurnInSettings -> BurnInSettings -> Bool # | |
Read BurnInSettings Source # | |
Defined in Mcmc.Settings Methods readsPrec :: Int -> ReadS BurnInSettings # readList :: ReadS [BurnInSettings] # | |
Show BurnInSettings Source # | |
Defined in Mcmc.Settings Methods showsPrec :: Int -> BurnInSettings -> ShowS # show :: BurnInSettings -> String # showList :: [BurnInSettings] -> ShowS # | |
ToJSON BurnInSettings Source # | |
Defined in Mcmc.Settings Methods toJSON :: BurnInSettings -> Value # toEncoding :: BurnInSettings -> Encoding # toJSONList :: [BurnInSettings] -> Value # toEncodingList :: [BurnInSettings] -> Encoding # | |
FromJSON BurnInSettings Source # | |
Defined in Mcmc.Settings Methods parseJSON :: Value -> Parser BurnInSettings # parseJSONList :: Value -> Parser [BurnInSettings] # |
burnInIterations :: BurnInSettings -> 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 TraceLength Source #
The length of the stored Mcmc.Chain.Trace.
Be careful, this setting determines the memory requirement of the MCMC chain.
Constructors
TraceAuto | Automatically determine the minimum length of the trace. The value is the maximum of used
|
TraceMinimum Int | Store a given minimum number of iterations of the chain. Store more
iterations if required (see |
Instances
Eq TraceLength Source # | |
Defined in Mcmc.Settings | |
Show TraceLength Source # | |
Defined in Mcmc.Settings Methods showsPrec :: Int -> TraceLength -> ShowS # show :: TraceLength -> String # showList :: [TraceLength] -> ShowS # | |
ToJSON TraceLength Source # | |
Defined in Mcmc.Settings Methods toJSON :: TraceLength -> Value # toEncoding :: TraceLength -> Encoding # toJSONList :: [TraceLength] -> Value # toEncodingList :: [TraceLength] -> Encoding # | |
FromJSON TraceLength 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] # |
class HasExecutionMode s where Source #
Types with execution modes.
Methods
getExecutionMode :: s -> ExecutionMode Source #
Instances
HasExecutionMode Settings Source # | |
Defined in Mcmc.Settings Methods | |
HasExecutionMode MLSettings Source # | |
Defined in Mcmc.MarginalLikelihood Methods | |
HasExecutionMode s => HasExecutionMode (Environment s) Source # | |
Defined in Mcmc.Environment Methods getExecutionMode :: Environment s -> ExecutionMode Source # |
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 some time. If the calculation of the next state is fast, sequential execution is usually beneficial, even for algorithms involving parallel chains.
- The Mcmc.Algorithm.MHG 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 unaware about 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] # |
Define information stored on disk.
Constructors
NoSave | Do not save the MCMC analysis. The analysis can not be continued. |
Save | Save the MCMC analysis so that it can be continued. This can be slow,
if the trace is long, or if the states are large objects. See
|
Constructors
LogStdOutAndFile | |
LogStdOutOnly | |
LogFileOnly |
Not much to say here.
Instances
Eq Verbosity Source # | |
Ord Verbosity Source # | |
Read Verbosity Source # | |
Show Verbosity Source # | |
ToJSON Verbosity Source # | |
Defined in Mcmc.Logger | |
FromJSON Verbosity Source # | |
Settings
Settings of an MCMC sampler.
Constructors
Settings | |
Instances
Eq Settings Source # | |
Show Settings Source # | |
ToJSON Settings Source # | |
Defined in Mcmc.Settings | |
FromJSON Settings Source # | |
HasVerbosity Settings Source # | |
Defined in Mcmc.Settings Methods getVerbosity :: Settings -> Verbosity Source # | |
HasLogMode Settings Source # | |
Defined in Mcmc.Settings Methods getLogMode :: Settings -> LogMode Source # | |
HasAnalysisName Settings Source # | |
Defined in Mcmc.Settings Methods | |
HasExecutionMode Settings Source # | |
Defined in Mcmc.Settings Methods |
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
.
settingsPrettyPrint :: Settings -> ByteString Source #
Pretty print settings.