lazyppl-1.0: Lazy Probabilistic Programming Library
Safe HaskellSafe-Inferred
LanguageHaskell2010

LazyPPL.Distributions

Description

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

Continuous distributions

normal Source #

Arguments

:: Double

mu, mean

-> Double

sigma, standard deviation

-> Prob Double 

gamma Source #

Arguments

:: Double

k, shape

-> Double

theta, scale

-> Prob Double 

dirichlet Source #

Arguments

:: [Double]

vector of alphas; length is dimension

-> Prob [Double] 

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

Streams

iid :: Prob a -> Prob [a] Source #

Returns an infinite stream of samples from the given distribution. -