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[ajHg]) Bool => CDF (Bernoulli b[ajHg]) Word64 CDF (Bernoulli b[ajHg]) Bool => CDF (Bernoulli b[ajHg]) Word32 CDF (Bernoulli b[ajHg]) Bool => CDF (Bernoulli b[ajHg]) Word16 CDF (Bernoulli b[ajHg]) Bool => CDF (Bernoulli b[ajHg]) Word8 CDF (Bernoulli b[ajHg]) Bool => CDF (Bernoulli b[ajHg]) Int64 CDF (Bernoulli b[ajHg]) Bool => CDF (Bernoulli b[ajHg]) Int32 CDF (Bernoulli b[ajHg]) Bool => CDF (Bernoulli b[ajHg]) Int16 CDF (Bernoulli b[ajHg]) Bool => CDF (Bernoulli b[ajHg]) Int8 CDF (Bernoulli b[ajHg]) Bool => CDF (Bernoulli b[ajHg]) Integer CDF (Bernoulli b[ajHg]) Bool => CDF (Bernoulli b[ajHg]) Int CDF (Bernoulli b[ajYS]) Bool => CDF (Bernoulli b[ajYS]) Double CDF (Bernoulli b[ajYS]) Bool => CDF (Bernoulli b[ajYS]) Float (Fractional b, Ord b, Distribution StdUniform b) => Distribution (Bernoulli b) Bool Distribution (Bernoulli b[ajHe]) Bool => Distribution (Bernoulli b[ajHe]) Word64 Distribution (Bernoulli b[ajHe]) Bool => Distribution (Bernoulli b[ajHe]) Word32 Distribution (Bernoulli b[ajHe]) Bool => Distribution (Bernoulli b[ajHe]) Word16 Distribution (Bernoulli b[ajHe]) Bool => Distribution (Bernoulli b[ajHe]) Word8 Distribution (Bernoulli b[ajHe]) Bool => Distribution (Bernoulli b[ajHe]) Int64 Distribution (Bernoulli b[ajHe]) Bool => Distribution (Bernoulli b[ajHe]) Int32 Distribution (Bernoulli b[ajHe]) Bool => Distribution (Bernoulli b[ajHe]) Int16 Distribution (Bernoulli b[ajHe]) Bool => Distribution (Bernoulli b[ajHe]) Int8 Distribution (Bernoulli b[ajHe]) Bool => Distribution (Bernoulli b[ajHe]) Integer Distribution (Bernoulli b[ajHe]) Bool => Distribution (Bernoulli b[ajHe]) Int Distribution (Bernoulli b[ajYQ]) Bool => Distribution (Bernoulli b[ajYQ]) Double Distribution (Bernoulli b[ajYQ]) Bool => Distribution (Bernoulli b[ajYQ]) 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)