Statistics.Distribution.NegativeBinomial

statistics-0.16.3.0: A library of statistical types, data, and functions

Copyright | (c) 2022 Lorenz Minder
License | BSD3
Maintainer | lminder@gmx.net
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Statistics.Distribution.NegativeBinomial

Contents

- Constructors
- Accessors

Description

The negative binomial distribution. This is the discrete probability distribution of the number of failures in a sequence of independent yes/no experiments before a specified number of successes r. Each Bernoulli trial has success probability p in the range (0, 1]. The parameter r must be positive, but does not have to be integer.

Synopsis

- data NegativeBinomialDistribution
- negativeBinomial :: Double -> Double -> NegativeBinomialDistribution
- negativeBinomialE :: Double -> Double -> Maybe NegativeBinomialDistribution
- nbdSuccesses :: NegativeBinomialDistribution -> Double
- nbdProbability :: NegativeBinomialDistribution -> Double

# Documentation

data NegativeBinomialDistribution #

The negative binomial distribution.

#### Instances

Instances details

FromJSON NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods parseJSON :: Value -> Parser NegativeBinomialDistribution # parseJSONList :: Value -> Parser [NegativeBinomialDistribution] # omittedField :: Maybe NegativeBinomialDistribution #
ToJSON NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods toJSON :: NegativeBinomialDistribution -> Value # toEncoding :: NegativeBinomialDistribution -> Encoding # toJSONList :: [NegativeBinomialDistribution] -> Value # toEncodingList :: [NegativeBinomialDistribution] -> Encoding # omitField :: NegativeBinomialDistribution -> Bool #
Binary NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods put :: NegativeBinomialDistribution -> Put # get :: Get NegativeBinomialDistribution # putList :: [NegativeBinomialDistribution] -> Put #
Data NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NegativeBinomialDistribution -> c NegativeBinomialDistribution # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NegativeBinomialDistribution # toConstr :: NegativeBinomialDistribution -> Constr # dataTypeOf :: NegativeBinomialDistribution -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NegativeBinomialDistribution) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NegativeBinomialDistribution) # gmapT :: (forall b. Data b => b -> b) -> NegativeBinomialDistribution -> NegativeBinomialDistribution # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NegativeBinomialDistribution -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NegativeBinomialDistribution -> r # gmapQ :: (forall d. Data d => d -> u) -> NegativeBinomialDistribution -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NegativeBinomialDistribution -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NegativeBinomialDistribution -> m NegativeBinomialDistribution # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NegativeBinomialDistribution -> m NegativeBinomialDistribution # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NegativeBinomialDistribution -> m NegativeBinomialDistribution #
Generic NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Associated Types
type Rep NegativeBinomialDistribution |
Instance details Defined in Statistics.Distribution.NegativeBinomial type Rep NegativeBinomialDistribution = D1 ('MetaData "NegativeBinomialDistribution" "Statistics.Distribution.NegativeBinomial" "statistics-0.16.3.0-JhFVwN7Kv9y2XSvDlj54t" 'False) (C1 ('MetaCons "NBD" 'PrefixI 'True) (S1 ('MetaSel ('Just "nbdSuccesses") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "nbdProbability") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Double)))
Methods from :: NegativeBinomialDistribution -> Rep NegativeBinomialDistribution x # to :: Rep NegativeBinomialDistribution x -> NegativeBinomialDistribution #
Read NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods readsPrec :: Int -> ReadS NegativeBinomialDistribution # readList :: ReadS [NegativeBinomialDistribution] # readPrec :: ReadPrec NegativeBinomialDistribution # readListPrec :: ReadPrec [NegativeBinomialDistribution] #
Show NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods showsPrec :: Int -> NegativeBinomialDistribution -> ShowS # show :: NegativeBinomialDistribution -> String # showList :: [NegativeBinomialDistribution] -> ShowS #
Eq NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods (==) :: NegativeBinomialDistribution -> NegativeBinomialDistribution -> Bool # (/=) :: NegativeBinomialDistribution -> NegativeBinomialDistribution -> Bool #
DiscreteDistr NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods probability :: NegativeBinomialDistribution -> Int -> Double # logProbability :: NegativeBinomialDistribution -> Int -> Double #
Distribution NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods cumulative :: NegativeBinomialDistribution -> Double -> Double # complCumulative :: NegativeBinomialDistribution -> Double -> Double #
Entropy NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods entropy :: NegativeBinomialDistribution -> Double #
MaybeEntropy NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods maybeEntropy :: NegativeBinomialDistribution -> Maybe Double #
MaybeMean NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods maybeMean :: NegativeBinomialDistribution -> Maybe Double #
MaybeVariance NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods maybeVariance :: NegativeBinomialDistribution -> Maybe Double # maybeStdDev :: NegativeBinomialDistribution -> Maybe Double #
Mean NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods mean :: NegativeBinomialDistribution -> Double #
Variance NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods variance :: NegativeBinomialDistribution -> Double # stdDev :: NegativeBinomialDistribution -> Double #
type Rep NegativeBinomialDistribution # |
Instance details Defined in Statistics.Distribution.NegativeBinomial type Rep NegativeBinomialDistribution = D1 ('MetaData "NegativeBinomialDistribution" "Statistics.Distribution.NegativeBinomial" "statistics-0.16.3.0-JhFVwN7Kv9y2XSvDlj54t" 'False) (C1 ('MetaCons "NBD" 'PrefixI 'True) (S1 ('MetaSel ('Just "nbdSuccesses") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "nbdProbability") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Double)))

# Constructors

negativeBinomial #

Arguments

:: Double | Number of successes.
-> Double | Success probability.
-> NegativeBinomialDistribution |

Construct negative binomial distribution. Number of failures r must be positive and probability must be in (0,1] range

negativeBinomialE #

Arguments

:: Double | Number of successes.
-> Double | Success probability.
-> Maybe NegativeBinomialDistribution |

Construct negative binomial distribution. Number of failures r must be positive and probability must be in (0,1] range

# Accessors

nbdSuccesses :: NegativeBinomialDistribution -> Double #

Number of successes until stop

nbdProbability :: NegativeBinomialDistribution -> Double #

Success probability.