random-fu-0.2.7.0: Random number generation

Safe HaskellNone
LanguageHaskell98

Data.Random.Distribution.Binomial

Synopsis

Documentation

integralBinomialCDF :: (Integral a, Real b) => a -> b -> a -> Double Source #

integralBinomialPDF :: (Integral a, Real b) => a -> b -> a -> Double Source #

The probability of getting exactly k successes in n trials is given by the probability mass function:

\[ f(k;n,p) = \Pr(X = k) = \binom n k p^k(1-p)^{n-k} \]

Note that in integralBinomialPDF the parameters of the mass function are given first and the range of the random variable distributed according to the binomial distribution is given last. That is, \(f(2;4,0.5)\) is calculated by integralBinomialPDF 4 0.5 2.

integralBinomialLogPdf :: (Integral a, Real b) => a -> b -> a -> Double Source #

We use the method given in "Fast and accurate computation of binomial probabilities, Loader, C", http://octave.1599824.n4.nabble.com/attachment/3829107/0/loader2000Fast.pdf

binomial :: Distribution (Binomial b) a => a -> b -> RVar a Source #

binomialT :: Distribution (Binomial b) a => a -> b -> RVarT m a Source #

data Binomial b a Source #

Constructors

Binomial a b 

Instances

(Real b0, Distribution (Binomial b0) Word64) => CDF (Binomial b0) Word64 Source # 

Methods

cdf :: Binomial b0 Word64 -> Word64 -> Double Source #

(Real b0, Distribution (Binomial b0) Word32) => CDF (Binomial b0) Word32 Source # 

Methods

cdf :: Binomial b0 Word32 -> Word32 -> Double Source #

(Real b0, Distribution (Binomial b0) Word16) => CDF (Binomial b0) Word16 Source # 

Methods

cdf :: Binomial b0 Word16 -> Word16 -> Double Source #

(Real b0, Distribution (Binomial b0) Word8) => CDF (Binomial b0) Word8 Source # 

Methods

cdf :: Binomial b0 Word8 -> Word8 -> Double Source #

(Real b0, Distribution (Binomial b0) Word) => CDF (Binomial b0) Word Source # 

Methods

cdf :: Binomial b0 Word -> Word -> Double Source #

(Real b0, Distribution (Binomial b0) Int64) => CDF (Binomial b0) Int64 Source # 

Methods

cdf :: Binomial b0 Int64 -> Int64 -> Double Source #

(Real b0, Distribution (Binomial b0) Int32) => CDF (Binomial b0) Int32 Source # 

Methods

cdf :: Binomial b0 Int32 -> Int32 -> Double Source #

(Real b0, Distribution (Binomial b0) Int16) => CDF (Binomial b0) Int16 Source # 

Methods

cdf :: Binomial b0 Int16 -> Int16 -> Double Source #

(Real b0, Distribution (Binomial b0) Int8) => CDF (Binomial b0) Int8 Source # 

Methods

cdf :: Binomial b0 Int8 -> Int8 -> Double Source #

(Real b0, Distribution (Binomial b0) Int) => CDF (Binomial b0) Int Source # 

Methods

cdf :: Binomial b0 Int -> Int -> Double Source #

(Real b0, Distribution (Binomial b0) Integer) => CDF (Binomial b0) Integer Source # 
CDF (Binomial b0) Integer => CDF (Binomial b0) Double Source # 

Methods

cdf :: Binomial b0 Double -> Double -> Double Source #

CDF (Binomial b0) Integer => CDF (Binomial b0) Float Source # 

Methods

cdf :: Binomial b0 Float -> Float -> Double Source #

(Real b0, Distribution (Binomial b0) Word64) => PDF (Binomial b0) Word64 Source # 
(Real b0, Distribution (Binomial b0) Word32) => PDF (Binomial b0) Word32 Source # 
(Real b0, Distribution (Binomial b0) Word16) => PDF (Binomial b0) Word16 Source # 
(Real b0, Distribution (Binomial b0) Word8) => PDF (Binomial b0) Word8 Source # 
(Real b0, Distribution (Binomial b0) Word) => PDF (Binomial b0) Word Source # 
(Real b0, Distribution (Binomial b0) Int64) => PDF (Binomial b0) Int64 Source # 
(Real b0, Distribution (Binomial b0) Int32) => PDF (Binomial b0) Int32 Source # 
(Real b0, Distribution (Binomial b0) Int16) => PDF (Binomial b0) Int16 Source # 
(Real b0, Distribution (Binomial b0) Int8) => PDF (Binomial b0) Int8 Source # 
(Real b0, Distribution (Binomial b0) Int) => PDF (Binomial b0) Int Source # 

Methods

pdf :: Binomial b0 Int -> Int -> Double Source #

logPdf :: Binomial b0 Int -> Int -> Double Source #

(Real b0, Distribution (Binomial b0) Integer) => PDF (Binomial b0) Integer Source # 
PDF (Binomial b0) Integer => PDF (Binomial b0) Double Source # 
PDF (Binomial b0) Integer => PDF (Binomial b0) Float Source # 
(Floating b0, Ord b0, Distribution Beta b0, Distribution StdUniform b0) => Distribution (Binomial b0) Word64 Source # 
(Floating b0, Ord b0, Distribution Beta b0, Distribution StdUniform b0) => Distribution (Binomial b0) Word32 Source # 
(Floating b0, Ord b0, Distribution Beta b0, Distribution StdUniform b0) => Distribution (Binomial b0) Word16 Source # 
(Floating b0, Ord b0, Distribution Beta b0, Distribution StdUniform b0) => Distribution (Binomial b0) Word8 Source # 
(Floating b0, Ord b0, Distribution Beta b0, Distribution StdUniform b0) => Distribution (Binomial b0) Word Source # 
(Floating b0, Ord b0, Distribution Beta b0, Distribution StdUniform b0) => Distribution (Binomial b0) Int64 Source # 
(Floating b0, Ord b0, Distribution Beta b0, Distribution StdUniform b0) => Distribution (Binomial b0) Int32 Source # 
(Floating b0, Ord b0, Distribution Beta b0, Distribution StdUniform b0) => Distribution (Binomial b0) Int16 Source # 
(Floating b0, Ord b0, Distribution Beta b0, Distribution StdUniform b0) => Distribution (Binomial b0) Int8 Source # 
(Floating b0, Ord b0, Distribution Beta b0, Distribution StdUniform b0) => Distribution (Binomial b0) Int Source # 
(Floating b0, Ord b0, Distribution Beta b0, Distribution StdUniform b0) => Distribution (Binomial b0) Integer Source # 
Distribution (Binomial b0) Integer => Distribution (Binomial b0) Double Source # 
Distribution (Binomial b0) Integer => Distribution (Binomial b0) Float Source #