mcmc-0.8.1.0: Sample from a posterior using Markov chain Monte Carlo
Copyright2021 Dominik Schrempf
LicenseGPL-3.0-or-later
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Mcmc.Settings

Description

Creation date: Mon Nov 16 11:13:01 2020.

Synopsis

Data types

newtype AnalysisName Source #

Analysis name of the MCMC sampler.

Constructors

AnalysisName 

class HasAnalysisName s where Source #

Types with analysis names.

Instances

Instances details
HasAnalysisName MLSettings Source # 
Instance details

Defined in Mcmc.MarginalLikelihood

HasAnalysisName Settings Source # 
Instance details

Defined in Mcmc.Settings

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 PSpeed.

For example, BurnInWithCustomAutoTuning [50] [100,200] performs 1a. 50 iterations without any slow proposals such as Hamiltonian proposals; 1b. Auto tuning; 2a. 100 iterations with all proposals; 2b Auto tuning; 3a. 200 iterations with all proposals; 3b. Auto tuning.

Usually it is useful to auto tune more frequently in the beginning of the MCMC run.

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

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 TraceAuto).

Instances

Instances details
FromJSON TraceLength Source # 
Instance details

Defined in Mcmc.Settings

ToJSON TraceLength Source # 
Instance details

Defined in Mcmc.Settings

Show TraceLength Source # 
Instance details

Defined in Mcmc.Settings

Eq TraceLength Source # 
Instance details

Defined in Mcmc.Settings

data ExecutionMode Source #

Execution mode.

Constructors

Fail

Perform new run.

Call error if an output files exists.

Overwrite

Perform new run.

Overwrite existing output files.

Continue

Continue a previous run and append to output files.

Call error if an output file does not exist.

class HasExecutionMode s where Source #

Types with execution modes.

openWithExecutionMode :: ExecutionMode -> FilePath -> IO Handle Source #

Open a file honoring the execution mode.

Call error if execution mode is

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.

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 

data SaveMode Source #

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 TraceLength.

Instances

Instances details
FromJSON SaveMode Source # 
Instance details

Defined in Mcmc.Settings

ToJSON SaveMode Source # 
Instance details

Defined in Mcmc.Settings

Read SaveMode Source # 
Instance details

Defined in Mcmc.Settings

Show SaveMode Source # 
Instance details

Defined in Mcmc.Settings

Eq SaveMode Source # 
Instance details

Defined in Mcmc.Settings

data LogMode Source #

Define where the log output should be directed to.

Logging is disabled if Verbosity is set to Quiet.

Instances

Instances details
FromJSON LogMode Source # 
Instance details

Defined in Mcmc.Logger

ToJSON LogMode Source # 
Instance details

Defined in Mcmc.Logger

Read LogMode Source # 
Instance details

Defined in Mcmc.Logger

Show LogMode Source # 
Instance details

Defined in Mcmc.Logger

Eq LogMode Source # 
Instance details

Defined in Mcmc.Logger

Methods

(==) :: LogMode -> LogMode -> Bool #

(/=) :: LogMode -> LogMode -> Bool #

data Verbosity Source #

Not much to say here.

Constructors

Quiet 
Warn 
Info 
Debug 

Settings

data Settings Source #

Settings of an MCMC sampler.

Instances

Instances details
FromJSON Settings Source # 
Instance details

Defined in Mcmc.Settings

ToJSON Settings Source # 
Instance details

Defined in Mcmc.Settings

Show Settings Source # 
Instance details

Defined in Mcmc.Settings

Eq Settings Source # 
Instance details

Defined in Mcmc.Settings

HasLogMode Settings Source # 
Instance details

Defined in Mcmc.Settings

HasVerbosity Settings Source # 
Instance details

Defined in Mcmc.Settings

HasAnalysisName Settings Source # 
Instance details

Defined in Mcmc.Settings

HasExecutionMode Settings Source # 
Instance details

Defined in Mcmc.Settings

settingsSave :: Settings -> IO () Source #

Save settings to a file determined by the analysis name.

settingsCheck Source #

Arguments

:: Settings 
-> Int

Current iteration.

-> IO () 

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.