Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This is adapted from https://jtobin.io/giry-monad-implementation but brought into the monad-bayes framework (i.e. Integrator is an instance of MonadMeasure) It's largely for debugging other inference methods and didactic use, because brute force integration of measures is only practical for small programs
Documentation
probability :: Ord a => (a, a) -> Integrator a -> Double Source #
expectation :: Integrator Double -> Double Source #
empirical :: Foldable f => f a -> Integrator a Source #
enumeratorWith :: Ord a => Set a -> Integrator a -> [(a, Double)] Source #
histogram :: (Enum a, Ord a, Fractional a) => Int -> a -> Weighted Integrator a -> [(a, Double)] Source #
normalize :: Weighted Integrator a -> Integrator a Source #
data Integrator a Source #
Instances
momentGeneratingFunction :: Integrator Double -> Double -> Double Source #
integrator :: (a -> Double) -> Integrator a -> Double Source #
runIntegrator :: (a -> Double) -> Integrator a -> Double Source #