Copyright | (c) Dominik Schrempf 2020 |
---|---|
License | GPL-3.0-or-later |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Creation date: Fri May 29 11:11:49 2020.
Batch mean monitors.
Synopsis
- data MonitorParameterBatch a = MonitorParameterBatch {}
- (>$<) :: Contravariant f => (a -> b) -> f b -> f a
- (@#) :: (b -> a) -> MonitorParameterBatch a -> MonitorParameterBatch b
- monitorBatchMean :: Real a => String -> MonitorParameterBatch a
- monitorBatchMeanF :: Real a => String -> MonitorParameterBatch a
- monitorBatchMeanE :: Real a => String -> MonitorParameterBatch a
- monitorBatchCustom :: String -> ([a] -> a) -> (a -> Builder) -> MonitorParameterBatch a
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.
Convert a batch monitor from one data type to another with '(>$<)'.
For example, batch monitor the mean of the first entry of a tuple:
mon = fst >$< monitorBatchMean
XXX: Batch monitors are slow at the moment because the monitored parameter has to be extracted from the state for each iteration.
Instances
Contravariant MonitorParameterBatch Source # | |
Defined in Mcmc.Monitor.ParameterBatch contramap :: (a -> b) -> MonitorParameterBatch b -> MonitorParameterBatch a # (>$) :: b -> MonitorParameterBatch b -> MonitorParameterBatch a # |
(>$<) :: Contravariant f => (a -> b) -> f b -> f a infixl 4 #
This is an infix alias for contramap
.
(@#) :: (b -> a) -> MonitorParameterBatch a -> MonitorParameterBatch b Source #
Deprecated: Superseded by the contravariant instance, use '(>$<)'.
Convert a batch parameter monitor from one data type to another.
For example, to batch monitor the mean of the first entry of a tuple:
mon = fst @# monitorBatchMean
:: Real a | |
=> String | Name. |
-> MonitorParameterBatch a |
Batch monitor. Print the mean with eight decimal places (half precision).
:: 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.
:: Real a | |
=> String | Name. |
-> MonitorParameterBatch a |
Batch monitor real float parameters such as Double
with scientific
notation and eight decimal places.
:: String | Name. |
-> ([a] -> a) | Function to calculate the batch mean. |
-> (a -> Builder) | Custom builder. |
-> MonitorParameterBatch a |
Batch monitor parameters with custom lens and builder.