Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Handy distributions for the LazyPPL
library, based on the uniform
distribution. Mostly defined using the Distribution
module and family.
Sometimes both a distribution (type Prob a
) and pdf (type a -> Double
) are given. Distributions are useful for sampling, densities are used for scoring.
For more distributions, see the Statistics.Distribution in the statistics package.
Synopsis
- normal :: Double -> Double -> Prob Double
- normalPdf :: Double -> Double -> Double -> Double
- exponential :: Double -> Prob Double
- expPdf :: Double -> Double -> Double
- gamma :: Double -> Double -> Prob Double
- beta :: Double -> Double -> Prob Double
- dirichlet :: [Double] -> Prob [Double]
- uniformbounded :: Double -> Double -> Prob Double
- bernoulli :: Double -> Prob Bool
- uniformdiscrete :: Int -> Prob Int
- categorical :: [Double] -> Prob Int
- poisson :: Double -> Prob Integer
- poissonPdf :: Double -> Integer -> Double
- iid :: Prob a -> Prob [a]
Continuous distributions
Discrete distributions
categorical :: [Double] -> Prob Int Source #
Categorical distribution: Takes a list of k numbers that sum to 1, and returns a random number between 0 and (k-1), weighted accordingly