Data.Random.Distribution
Synopsis
class Distribution d t where
 rvar :: d t -> RVar t sampleFrom :: RandomSource m s => s -> d t -> m t
sample :: (Distribution d t, MonadRandom m) => d t -> m t
Documentation
 class Distribution d t where Source

A definition of a random variable's distribution. From the distribution an RVar can be created, or the distribution can be directly sampled. RVar in particular is an instance of Distribution, and so can be sampled.

Minimum instance definition: either rvar or sampleFrom.

Methods
 rvar :: d t -> RVar t Source
Return a random variable with this distribution.
 sampleFrom :: RandomSource m s => s -> d t -> m t Source
Directly sample from the distribution, given a source of entropy.
Instances
 Distribution RVar a StdUniformByClassification c t => Distribution StdUniform t UniformByClassification c t => Distribution Uniform t RealFloat a => Distribution Exponential a (Floating a, Distribution Uniform a) => Distribution Normal a RealFloat a => Distribution Gamma a RealFloat a => Distribution Beta a RealFloat a => Distribution Triangular a (BernoulliByClassification c t, RealFloat b) => Distribution (Bernoulli b) t (Num p, Ord p, Distribution Uniform p) => Distribution (Discrete p) a (BinomialByClassification c t, RealFloat b) => Distribution (Binomial b) t RealFloat b => Distribution (Poisson b) Double RealFloat b => Distribution (Poisson b) Double RealFloat b => Distribution (Poisson b) Float RealFloat b => Distribution (Poisson b) Float RealFloat b => Distribution (Poisson b) Integer RealFloat b => Distribution (Poisson b) Integer RealFloat b => Distribution (Poisson b) Word64 RealFloat b => Distribution (Poisson b) Word64 RealFloat b => Distribution (Poisson b) Word32 RealFloat b => Distribution (Poisson b) Word32 RealFloat b => Distribution (Poisson b) Word16 RealFloat b => Distribution (Poisson b) Word16 RealFloat b => Distribution (Poisson b) Word8 RealFloat b => Distribution (Poisson b) Word8 RealFloat b => Distribution (Poisson b) Int64 RealFloat b => Distribution (Poisson b) Int64 RealFloat b => Distribution (Poisson b) Int32 RealFloat b => Distribution (Poisson b) Int32 RealFloat b => Distribution (Poisson b) Int16 RealFloat b => Distribution (Poisson b) Int16 RealFloat b => Distribution (Poisson b) Int8 RealFloat b => Distribution (Poisson b) Int8 RealFloat b => Distribution (Poisson b) Int RealFloat b => Distribution (Poisson b) Int
 sample :: (Distribution d t, MonadRandom m) => d t -> m t Source
Sample a distribution using the default source of entropy for the monad in which the sampling occurs.