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 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.
Instances
class HasAnalysisName s where Source #
Types with analysis names.
getAnalysisName :: s -> AnalysisName Source #
Instances
HasAnalysisName MLSettings Source # | |
Defined in Mcmc.MarginalLikelihood | |
HasAnalysisName Settings Source # | |
Defined in Mcmc.Settings |
data BurnInSettings 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. |
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
FromJSON BurnInSettings Source # | |
Defined in Mcmc.Settings parseJSON :: Value -> Parser BurnInSettings # parseJSONList :: Value -> Parser [BurnInSettings] # | |
ToJSON BurnInSettings Source # | |
Defined in Mcmc.Settings toJSON :: BurnInSettings -> Value # toEncoding :: BurnInSettings -> Encoding # toJSONList :: [BurnInSettings] -> Value # toEncodingList :: [BurnInSettings] -> Encoding # | |
Read BurnInSettings Source # | |
Defined in Mcmc.Settings readsPrec :: Int -> ReadS BurnInSettings # readList :: ReadS [BurnInSettings] # | |
Show BurnInSettings Source # | |
Defined in Mcmc.Settings showsPrec :: Int -> BurnInSettings -> ShowS # show :: BurnInSettings -> String # showList :: [BurnInSettings] -> ShowS # | |
Eq BurnInSettings Source # | |
Defined in Mcmc.Settings (==) :: BurnInSettings -> BurnInSettings -> Bool # (/=) :: BurnInSettings -> BurnInSettings -> Bool # |
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.
Instances
FromJSON Iterations Source # | |
Defined in Mcmc.Settings parseJSON :: Value -> Parser Iterations # parseJSONList :: Value -> Parser [Iterations] # | |
ToJSON Iterations Source # | |
Defined in Mcmc.Settings toJSON :: Iterations -> Value # toEncoding :: Iterations -> Encoding # toJSONList :: [Iterations] -> Value # toEncodingList :: [Iterations] -> Encoding # | |
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 # | |
Eq Iterations Source # | |
Defined in Mcmc.Settings (==) :: Iterations -> Iterations -> Bool # (/=) :: Iterations -> Iterations -> Bool # |
data TraceLength Source #
The length of the stored Mcmc.Chain.Trace.
Be careful, this setting determines the memory requirement of the MCMC chain.
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
FromJSON TraceLength Source # | |
Defined in Mcmc.Settings parseJSON :: Value -> Parser TraceLength # parseJSONList :: Value -> Parser [TraceLength] # | |
ToJSON TraceLength Source # | |
Defined in Mcmc.Settings toJSON :: TraceLength -> Value # toEncoding :: TraceLength -> Encoding # toJSONList :: [TraceLength] -> Value # toEncodingList :: [TraceLength] -> Encoding # | |
Show TraceLength Source # | |
Defined in Mcmc.Settings showsPrec :: Int -> TraceLength -> ShowS # show :: TraceLength -> String # showList :: [TraceLength] -> ShowS # | |
Eq TraceLength Source # | |
Defined in Mcmc.Settings (==) :: TraceLength -> TraceLength -> Bool # (/=) :: TraceLength -> TraceLength -> Bool # |
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
FromJSON ExecutionMode Source # | |
Defined in Mcmc.Settings parseJSON :: Value -> Parser ExecutionMode # parseJSONList :: Value -> Parser [ExecutionMode] # | |
ToJSON ExecutionMode Source # | |
Defined in Mcmc.Settings toJSON :: ExecutionMode -> Value # toEncoding :: ExecutionMode -> Encoding # toJSONList :: [ExecutionMode] -> Value # toEncodingList :: [ExecutionMode] -> Encoding # | |
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 # | |
Eq ExecutionMode Source # | |
Defined in Mcmc.Settings (==) :: ExecutionMode -> ExecutionMode -> Bool # (/=) :: ExecutionMode -> ExecutionMode -> Bool # |
class HasExecutionMode s where Source #
Types with execution modes.
getExecutionMode :: s -> ExecutionMode Source #
Instances
HasExecutionMode MLSettings Source # | |
Defined in Mcmc.MarginalLikelihood | |
HasExecutionMode Settings Source # | |
Defined in Mcmc.Settings | |
HasExecutionMode s => HasExecutionMode (Environment s) Source # | |
Defined in Mcmc.Environment 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.
Instances
FromJSON ParallelizationMode Source # | |
Defined in Mcmc.Settings parseJSON :: Value -> Parser ParallelizationMode # parseJSONList :: Value -> Parser [ParallelizationMode] # | |
ToJSON ParallelizationMode Source # | |
Defined in Mcmc.Settings toJSON :: ParallelizationMode -> Value # toEncoding :: ParallelizationMode -> Encoding # toJSONList :: [ParallelizationMode] -> Value # toEncodingList :: [ParallelizationMode] -> Encoding # | |
Read ParallelizationMode Source # | |
Defined in Mcmc.Settings | |
Show ParallelizationMode Source # | |
Defined in Mcmc.Settings showsPrec :: Int -> ParallelizationMode -> ShowS # show :: ParallelizationMode -> String # showList :: [ParallelizationMode] -> ShowS # | |
Eq ParallelizationMode Source # | |
Defined in Mcmc.Settings (==) :: ParallelizationMode -> ParallelizationMode -> Bool # (/=) :: ParallelizationMode -> ParallelizationMode -> Bool # |
Define information stored on disk.
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
|
Not much to say here.
Settings
Settings of an MCMC sampler.
Instances
FromJSON Settings Source # | |
ToJSON Settings Source # | |
Defined in Mcmc.Settings | |
Show Settings Source # | |
Eq Settings Source # | |
HasLogMode Settings Source # | |
Defined in Mcmc.Settings getLogMode :: Settings -> LogMode Source # | |
HasVerbosity Settings Source # | |
Defined in Mcmc.Settings getVerbosity :: Settings -> Verbosity Source # | |
HasAnalysisName Settings Source # | |
Defined in Mcmc.Settings | |
HasExecutionMode Settings Source # | |
Defined in Mcmc.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
.
settingsPrettyPrint :: Settings -> ByteString Source #
Pretty print settings.