| Safe Haskell | None |
|---|
Data.Random.Distribution.Bernoulli
- bernoulli :: Distribution (Bernoulli b) a => b -> RVar a
- bernoulliT :: Distribution (Bernoulli b) a => b -> RVarT m a
- boolBernoulli :: (Fractional a, Ord a, Distribution StdUniform a) => a -> RVarT m Bool
- boolBernoulliCDF :: Real a => a -> Bool -> Double
- generalBernoulli :: Distribution (Bernoulli b) Bool => a -> a -> b -> RVarT m a
- generalBernoulliCDF :: CDF (Bernoulli b) Bool => (a -> a -> Bool) -> a -> a -> b -> a -> Double
- newtype Bernoulli b a = Bernoulli b
Documentation
bernoulli :: Distribution (Bernoulli b) a => b -> RVar aSource
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 aSource
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 BoolSource
boolBernoulliCDF :: Real a => a -> Bool -> DoubleSource
generalBernoulli :: Distribution (Bernoulli b) Bool => a -> a -> b -> RVarT m aSource
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 -> DoubleSource
Constructors
| Bernoulli b |
Instances