mcmc-0.1.3: Sample from a posterior using Markov chain Monte Carlo

Copyright(c) Dominik Schrempf 2020
LicenseGPL-3.0-or-later
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Mcmc.Monitor

Contents

Description

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

Synopsis

Create monitors

data Monitor a Source #

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

data MonitorStdOut a Source #

Monitor to standard output.

monitorStdOut Source #

Arguments

:: [MonitorParameter a]

Instructions about which parameters to log.

-> Int

Logging period.

-> MonitorStdOut a 

Monitor to standard output.

data MonitorFile a Source #

Monitor to a file.

monitorFile Source #

Arguments

:: String

Name; used as part of the file name.

-> [MonitorParameter a]

Instructions about which parameters to log.

-> Int

Logging period.

-> MonitorFile a 

Monitor parameters to a file.

data MonitorBatch a Source #

Monitor to a file, but calculate batch means for the given batch size.

XXX: Batch monitors are slow at the moment because the monitored parameter has to be extracted from the state for each iteration.

monitorBatch Source #

Arguments

:: String

Name; used as part of the file name.

-> [MonitorParameterBatch a]

Instructions about which parameters to log and how to calculate the batch means.

-> Int

Batch size.

-> MonitorBatch a 

Monitor parameters to a file, see MonitorBatch.

Use monitor

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

Open the files associated with the Monitor.

mAppend :: String -> Monitor a -> IO (Monitor a) Source #

Open the files associated with the Monitor in append mode.

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

Print header line of Monitor (standard output only).

mExec Source #

Arguments

:: Int

Iteration.

-> (Int, UTCTime)

Starting state and time.

-> Trace a

Trace of Markov chain.

-> Int

Total number of iterations; to calculate ETA.

-> Monitor a

The monitor.

-> IO () 

Execute monitors; print status information to standard output and files.

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

Close the files associated with the Monitor.