mcmc-0.2.1: 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.ParameterBatch

Contents

Description

Creation date: Fri May 29 11:11:49 2020.

Batch mean monitors.

Synopsis

Batch parameter monitors

data MonitorParameterBatch a Source #

Instruction about a parameter to monitor via batch means. Usually, the monitored parameter is average over the batch size. However, arbitrary functions performing more complicated analyses on the states in the batch can be provided.

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

Constructors

MonitorParameterBatch 

Fields

  • mbpName :: String

    Name of batch monitored parameter.

  • mbpFunc :: [a] -> Builder

    Instruction about how to extract the batch mean from the trace.

(@#) :: Lens' b a -> MonitorParameterBatch a -> MonitorParameterBatch b Source #

Convert a batch parameter monitor from one data type to another using a lens.

For example, to batch monitor a real float value being the first entry of a tuple:

mon = _1 @# monitorBatchMeanRealFloat

monitorBatchMean Source #

Arguments

:: Real a 
=> String

Name.

-> MonitorParameterBatch a 

Batch monitor. Print the mean with eight decimal places (half precision).

monitorBatchMeanF Source #

Arguments

:: Real a 
=> String

Name.

-> MonitorParameterBatch a 

Batch monitor. Print the mean with full precision computing the shortest string of digits that correctly represent the number.

monitorBatchMeanE Source #

Arguments

:: Real a 
=> String

Name.

-> MonitorParameterBatch a 

Batch monitor real float parameters such as Double with scientific notation and eight decimal places.

monitorBatchCustom Source #

Arguments

:: String

Name.

-> ([a] -> a)

Function to calculate the batch mean.

-> (a -> Builder)

Custom builder.

-> MonitorParameterBatch a 

Batch monitor parameters with custom lens and builder.