Safe Haskell | None |
---|

- data Distr a = Distr {
- sample :: forall g. RandomGen g => Rand g a
- logProbability :: a -> Double

- negativeInfinity :: Double
- sumByLogs :: [Double] -> Double
- categorical :: Eq a => [(a, Double)] -> Distr a
- uniform :: Eq a => [a] -> Distr a
- randInt :: (Integral i, Random i) => (i, i) -> Distr i
- replicate :: Int -> Distr a -> Distr [a]
- mix :: [(Distr a, Double)] -> Distr a
- constant :: a -> Distr a

# Documentation

Represents a discrete probability distribution.

negativeInfinity :: DoubleSource

Negative infinity, the log of 0 probability.

categorical :: Eq a => [(a, Double)] -> Distr aSource

A distribution from an (item, weight) list.

randInt :: (Integral i, Random i) => (i, i) -> Distr iSource

A distribution over some integral type, inclusively between the 2 values.