Data.Random.Distribution.Bernoulli
Synopsis
 bernoulli :: Distribution (Bernoulli b) a => b -> RVar a boolBernoulli :: (Fractional a, Ord a, Distribution StdUniform a) => a -> RVar Bool boolBernoulliCDF :: Real a => a -> Bool -> Double generalBernoulli :: Distribution (Bernoulli b) Bool => a -> a -> b -> RVar a generalBernoulliCDF :: CDF (Bernoulli b) Bool => (a -> a -> Bool) -> a -> a -> b -> a -> Double data Bernoulli b a = Bernoulli b
Documentation
 bernoulli :: Distribution (Bernoulli b) a => b -> RVar a Source
Generate a Bernoulli variate with the given probability. For Bool results, bernoulli p will return True (p*100)% of the time and False otherwise. For numerical types, True is replaced by 1 and False by 0.
 boolBernoulli :: (Fractional a, Ord a, Distribution StdUniform a) => a -> RVar Bool Source
A random variable whose value is True the given fraction of the time and False the rest.
 boolBernoulliCDF :: Real a => a -> Bool -> Double Source
 generalBernoulli :: Distribution (Bernoulli b) Bool => a -> a -> b -> RVar a Source
generalBernoulli t f p generates a random variable whose value is t with probability p and f with probability 1-p.
 generalBernoulliCDF :: CDF (Bernoulli b) Bool => (a -> a -> Bool) -> a -> a -> b -> a -> Double Source
 data Bernoulli b a Source
Constructors
 Bernoulli b
Instances
 (Distribution (Bernoulli b) Bool, Real b) => CDF (Bernoulli b) Bool CDF (Bernoulli b[akz4]) Bool => CDF (Bernoulli b[akz4]) Word64 CDF (Bernoulli b[akz4]) Bool => CDF (Bernoulli b[akz4]) Word32 CDF (Bernoulli b[akz4]) Bool => CDF (Bernoulli b[akz4]) Word16 CDF (Bernoulli b[akz4]) Bool => CDF (Bernoulli b[akz4]) Word8 CDF (Bernoulli b[akz4]) Bool => CDF (Bernoulli b[akz4]) Int64 CDF (Bernoulli b[akz4]) Bool => CDF (Bernoulli b[akz4]) Int32 CDF (Bernoulli b[akz4]) Bool => CDF (Bernoulli b[akz4]) Int16 CDF (Bernoulli b[akz4]) Bool => CDF (Bernoulli b[akz4]) Int8 CDF (Bernoulli b[akz4]) Bool => CDF (Bernoulli b[akz4]) Integer CDF (Bernoulli b[akz4]) Bool => CDF (Bernoulli b[akz4]) Int CDF (Bernoulli b[akQG]) Bool => CDF (Bernoulli b[akQG]) Double CDF (Bernoulli b[akQG]) Bool => CDF (Bernoulli b[akQG]) Float (Fractional b, Ord b, Distribution StdUniform b) => Distribution (Bernoulli b) Bool Distribution (Bernoulli b[akz2]) Bool => Distribution (Bernoulli b[akz2]) Word64 Distribution (Bernoulli b[akz2]) Bool => Distribution (Bernoulli b[akz2]) Word32 Distribution (Bernoulli b[akz2]) Bool => Distribution (Bernoulli b[akz2]) Word16 Distribution (Bernoulli b[akz2]) Bool => Distribution (Bernoulli b[akz2]) Word8 Distribution (Bernoulli b[akz2]) Bool => Distribution (Bernoulli b[akz2]) Int64 Distribution (Bernoulli b[akz2]) Bool => Distribution (Bernoulli b[akz2]) Int32 Distribution (Bernoulli b[akz2]) Bool => Distribution (Bernoulli b[akz2]) Int16 Distribution (Bernoulli b[akz2]) Bool => Distribution (Bernoulli b[akz2]) Int8 Distribution (Bernoulli b[akz2]) Bool => Distribution (Bernoulli b[akz2]) Integer Distribution (Bernoulli b[akz2]) Bool => Distribution (Bernoulli b[akz2]) Int Distribution (Bernoulli b[akQE]) Bool => Distribution (Bernoulli b[akQE]) Double Distribution (Bernoulli b[akQE]) Bool => Distribution (Bernoulli b[akQE]) Float (CDF (Bernoulli b) Bool, RealFloat a) => CDF (Bernoulli b) (Complex a) (CDF (Bernoulli b) Bool, Integral a) => CDF (Bernoulli b) (Ratio a) (Distribution (Bernoulli b) Bool, RealFloat a) => Distribution (Bernoulli b) (Complex a) (Distribution (Bernoulli b) Bool, Integral a) => Distribution (Bernoulli b) (Ratio a)