random-fu-0.2.7.0: Random number generation

Safe HaskellNone
LanguageHaskell98

Data.Random.Distribution.Bernoulli

Synopsis

Documentation

bernoulli :: Distribution (Bernoulli b) a => b -> RVar a #

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 #

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 #

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 #

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 #

newtype Bernoulli b a #

Constructors

Bernoulli b 

Instances

(Distribution (Bernoulli b) Bool, Real b) => CDF (Bernoulli b) Bool # 

Methods

cdf :: Bernoulli b Bool -> Bool -> Double #

CDF (Bernoulli b0) Bool => CDF (Bernoulli b0) Word64 # 

Methods

cdf :: Bernoulli b0 Word64 -> Word64 -> Double #

CDF (Bernoulli b0) Bool => CDF (Bernoulli b0) Word32 # 

Methods

cdf :: Bernoulli b0 Word32 -> Word32 -> Double #

CDF (Bernoulli b0) Bool => CDF (Bernoulli b0) Word16 # 

Methods

cdf :: Bernoulli b0 Word16 -> Word16 -> Double #

CDF (Bernoulli b0) Bool => CDF (Bernoulli b0) Word8 # 

Methods

cdf :: Bernoulli b0 Word8 -> Word8 -> Double #

CDF (Bernoulli b0) Bool => CDF (Bernoulli b0) Word # 

Methods

cdf :: Bernoulli b0 Word -> Word -> Double #

CDF (Bernoulli b0) Bool => CDF (Bernoulli b0) Int64 # 

Methods

cdf :: Bernoulli b0 Int64 -> Int64 -> Double #

CDF (Bernoulli b0) Bool => CDF (Bernoulli b0) Int32 # 

Methods

cdf :: Bernoulli b0 Int32 -> Int32 -> Double #

CDF (Bernoulli b0) Bool => CDF (Bernoulli b0) Int16 # 

Methods

cdf :: Bernoulli b0 Int16 -> Int16 -> Double #

CDF (Bernoulli b0) Bool => CDF (Bernoulli b0) Int8 # 

Methods

cdf :: Bernoulli b0 Int8 -> Int8 -> Double #

CDF (Bernoulli b0) Bool => CDF (Bernoulli b0) Int # 

Methods

cdf :: Bernoulli b0 Int -> Int -> Double #

CDF (Bernoulli b0) Bool => CDF (Bernoulli b0) Integer # 

Methods

cdf :: Bernoulli b0 Integer -> Integer -> Double #

CDF (Bernoulli b0) Bool => CDF (Bernoulli b0) Double # 

Methods

cdf :: Bernoulli b0 Double -> Double -> Double #

CDF (Bernoulli b0) Bool => CDF (Bernoulli b0) Float # 

Methods

cdf :: Bernoulli b0 Float -> Float -> Double #

(Fractional b, Ord b, Distribution StdUniform b) => Distribution (Bernoulli b) Bool # 
Distribution (Bernoulli b0) Bool => Distribution (Bernoulli b0) Word64 # 
Distribution (Bernoulli b0) Bool => Distribution (Bernoulli b0) Word32 # 
Distribution (Bernoulli b0) Bool => Distribution (Bernoulli b0) Word16 # 
Distribution (Bernoulli b0) Bool => Distribution (Bernoulli b0) Word8 # 
Distribution (Bernoulli b0) Bool => Distribution (Bernoulli b0) Word # 

Methods

rvar :: Bernoulli b0 Word -> RVar Word #

rvarT :: Bernoulli b0 Word -> RVarT n Word #

Distribution (Bernoulli b0) Bool => Distribution (Bernoulli b0) Int64 # 
Distribution (Bernoulli b0) Bool => Distribution (Bernoulli b0) Int32 # 
Distribution (Bernoulli b0) Bool => Distribution (Bernoulli b0) Int16 # 
Distribution (Bernoulli b0) Bool => Distribution (Bernoulli b0) Int8 # 

Methods

rvar :: Bernoulli b0 Int8 -> RVar Int8 #

rvarT :: Bernoulli b0 Int8 -> RVarT n Int8 #

Distribution (Bernoulli b0) Bool => Distribution (Bernoulli b0) Int # 

Methods

rvar :: Bernoulli b0 Int -> RVar Int #

rvarT :: Bernoulli b0 Int -> RVarT n Int #

Distribution (Bernoulli b0) Bool => Distribution (Bernoulli b0) Integer # 
Distribution (Bernoulli b0) Bool => Distribution (Bernoulli b0) Double # 
Distribution (Bernoulli b0) Bool => Distribution (Bernoulli b0) Float # 
(CDF (Bernoulli b) Bool, RealFloat a) => CDF (Bernoulli b) (Complex a) # 

Methods

cdf :: Bernoulli b (Complex a) -> Complex a -> Double #

(CDF (Bernoulli b) Bool, Integral a) => CDF (Bernoulli b) (Ratio a) # 

Methods

cdf :: Bernoulli b (Ratio a) -> Ratio a -> Double #

(Distribution (Bernoulli b) Bool, RealFloat a) => Distribution (Bernoulli b) (Complex a) # 

Methods

rvar :: Bernoulli b (Complex a) -> RVar (Complex a) #

rvarT :: Bernoulli b (Complex a) -> RVarT n (Complex a) #

(Distribution (Bernoulli b) Bool, Integral a) => Distribution (Bernoulli b) (Ratio a) # 

Methods

rvar :: Bernoulli b (Ratio a) -> RVar (Ratio a) #

rvarT :: Bernoulli b (Ratio a) -> RVarT n (Ratio a) #