Copyright | (c) Adam Scibior 2015-2020 |
---|---|
License | MIT |
Maintainer | leonhard.markert@tweag.io |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data Enumerator a
- logExplicit :: Enumerator a -> [(a, Log Double)]
- explicit :: Enumerator a -> [(a, Double)]
- evidence :: Enumerator a -> Log Double
- mass :: Ord a => Enumerator a -> a -> Double
- compact :: (Num r, Ord a) => [(a, r)] -> [(a, r)]
- enumerate :: Ord a => Enumerator a -> [(a, Double)]
- expectation :: (a -> Double) -> Enumerator a -> Double
- normalForm :: Ord a => Enumerator a -> [(a, Double)]
Documentation
data Enumerator a Source #
An exact inference transformer that integrates discrete random variables by enumerating all execution paths.
Instances
logExplicit :: Enumerator a -> [(a, Log Double)] Source #
Returns the posterior as a list of weight-value pairs without any post-processing, such as normalization or aggregation
explicit :: Enumerator a -> [(a, Double)] Source #
Same as toList
, only weights are converted from log-domain.
evidence :: Enumerator a -> Log Double Source #
Returns the model evidence, that is sum of all weights.
mass :: Ord a => Enumerator a -> a -> Double Source #
Normalized probability mass of a specific value.
compact :: (Num r, Ord a) => [(a, r)] -> [(a, r)] Source #
Aggregate weights of equal values. The resulting list is sorted ascendingly according to values.
enumerate :: Ord a => Enumerator a -> [(a, Double)] Source #
Aggregate and normalize of weights. The resulting list is sorted ascendingly according to values.
enumerate = compact . explicit
expectation :: (a -> Double) -> Enumerator a -> Double Source #
Expectation of a given function computed using normalized weights.
normalForm :: Ord a => Enumerator a -> [(a, Double)] Source #
compact
followed by removing values with zero weight.