mcmc-0.8.0.1: 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.Monitor

Description

Creation date: Thu May 21 14:35:11 2020.

Synopsis

Create monitors

data Monitor a Source #

A Monitor observing the chain.

A Monitor describes which part of the Markov chain should be logged and where. Further, they allow output of summary statistics per iteration in a flexible way.

Constructors

Monitor 

Fields

type Period = Int Source #

Execute monitor every given number of iterations.

simpleMonitor :: Period -> Monitor a Source #

Only monitor prior, likelihood and posterior functions with given period. Do not monitor parameters.

data MonitorStdOut a Source #

Monitor to standard output; construct with monitorStdOut.

monitorStdOut :: [MonitorParameter a] -> Period -> MonitorStdOut a Source #

Monitor to standard output.

msHeader :: MonitorStdOut a -> ByteString Source #

Header of monitor to standard output.

data MonitorFile a Source #

Monitor to a file; constructed with monitorFile.

monitorFile Source #

Arguments

:: String

Name; used as part of the file name.

-> [MonitorParameter a] 
-> Period 
-> MonitorFile a 

Monitor parameters to a file.

type BatchSize = Int Source #

Size of the batch used to calculate summary statistics.

data MonitorBatch a Source #

Batch monitor to a file.

Calculate summary statistics over the last given number of iterations (batch size). Construct with monitorBatch.

monitorBatch Source #

Arguments

:: String

Name; used as part of the file name.

-> [MonitorParameterBatch a] 
-> BatchSize 
-> MonitorBatch a 

Batch monitor parameters to a file, see MonitorBatch.

getMonitorBatchSize :: MonitorBatch a -> BatchSize Source #

Batch monitor size.

Useful to determine the trace length.

Use monitors

mOpen :: String -> String -> ExecutionMode -> Monitor a -> IO (Monitor a) Source #

Open the files associated with the Monitor.

mExec Source #

Arguments

:: Verbosity 
-> Int

Iteration.

-> Int

Starting state.

-> UTCTime

Starting time.

-> Trace a 
-> Int

Total number of iterations; to calculate ETA.

-> Monitor a 
-> IO (Maybe ByteString) 

Execute monitors; print status information to files and return text to be printed to standard output and log file.

mClose :: Monitor a -> IO (Monitor a) Source #

Close the files associated with the Monitor.