random-fu-0.2.7.4: Random number generation

Data.Random.Distribution.Bernoulli

Synopsis

# 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.

bernoulliT :: Distribution (Bernoulli b) a => b -> RVarT m a Source #

Generate a Bernoulli process 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 -> RVarT m Bool Source #

A random variable whose value is True the given fraction of the time and False the rest.

generalBernoulli :: Distribution (Bernoulli b) Bool => a -> a -> b -> RVarT m 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 #

newtype Bernoulli b a Source #

Constructors

 Bernoulli b
Instances
 (Distribution (Bernoulli b) Bool, Real b) => CDF (Bernoulli b) Bool Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods CDF (Bernoulli b) Bool => CDF (Bernoulli b) Int Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods CDF (Bernoulli b) Bool => CDF (Bernoulli b) Int8 Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods CDF (Bernoulli b) Bool => CDF (Bernoulli b) Word Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methods (CDF (Bernoulli b) Bool, RealFloat a) => CDF (Bernoulli b) (Complex a) Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methodscdf :: Bernoulli b (Complex a) -> Complex a -> Double Source # (CDF (Bernoulli b) Bool, Integral a) => CDF (Bernoulli b) (Ratio a) Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methodscdf :: Bernoulli b (Ratio a) -> Ratio a -> Double Source # (Distribution (Bernoulli b) Bool, RealFloat a) => Distribution (Bernoulli b) (Complex a) Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methodsrvar :: Bernoulli b (Complex a) -> RVar (Complex a) Source #rvarT :: Bernoulli b (Complex a) -> RVarT n (Complex a) Source # (Distribution (Bernoulli b) Bool, Integral a) => Distribution (Bernoulli b) (Ratio a) Source # Instance detailsDefined in Data.Random.Distribution.Bernoulli Methodsrvar :: Bernoulli b (Ratio a) -> RVar (Ratio a) Source #rvarT :: Bernoulli b (Ratio a) -> RVarT n (Ratio a) Source #