statistics-0.16.2.1: 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 | Safe-Inferred
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 Source #

The negative binomial distribution.

#### Instances

Instances details

FromJSON NegativeBinomialDistribution Source # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods parseJSON :: Value -> Parser NegativeBinomialDistribution Source # parseJSONList :: Value -> Parser [NegativeBinomialDistribution] Source #
ToJSON NegativeBinomialDistribution Source # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods toJSON :: NegativeBinomialDistribution -> Value Source # toEncoding :: NegativeBinomialDistribution -> Encoding Source # toJSONList :: [NegativeBinomialDistribution] -> Value Source # toEncodingList :: [NegativeBinomialDistribution] -> Encoding Source #
Data NegativeBinomialDistribution Source # |

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

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NegativeBinomialDistribution Source #

toConstr :: NegativeBinomialDistribution -> Constr Source #

dataTypeOf :: NegativeBinomialDistribution -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NegativeBinomialDistribution) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NegativeBinomialDistribution) Source #

gmapT :: (forall b. Data b => b -> b) -> NegativeBinomialDistribution -> NegativeBinomialDistribution Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NegativeBinomialDistribution -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NegativeBinomialDistribution -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> NegativeBinomialDistribution -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NegativeBinomialDistribution -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NegativeBinomialDistribution -> m NegativeBinomialDistribution Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NegativeBinomialDistribution -> m NegativeBinomialDistribution Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NegativeBinomialDistribution -> m NegativeBinomialDistribution Source #

Generic NegativeBinomialDistribution Source # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Associated Types type Rep NegativeBinomialDistribution :: Type -> Type Source # Methods from :: NegativeBinomialDistribution -> Rep NegativeBinomialDistribution x Source # to :: Rep NegativeBinomialDistribution x -> NegativeBinomialDistribution Source #
Read NegativeBinomialDistribution Source # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods readsPrec :: Int -> ReadS NegativeBinomialDistribution Source # readList :: ReadS [NegativeBinomialDistribution] Source # readPrec :: ReadPrec NegativeBinomialDistribution Source # readListPrec :: ReadPrec [NegativeBinomialDistribution] Source #
Show NegativeBinomialDistribution Source # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods showsPrec :: Int -> NegativeBinomialDistribution -> ShowS Source # show :: NegativeBinomialDistribution -> String Source # showList :: [NegativeBinomialDistribution] -> ShowS Source #
Binary NegativeBinomialDistribution Source # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods put :: NegativeBinomialDistribution -> Put Source # get :: Get NegativeBinomialDistribution Source # putList :: [NegativeBinomialDistribution] -> Put Source #
Eq NegativeBinomialDistribution Source # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods (==) :: NegativeBinomialDistribution -> NegativeBinomialDistribution -> Bool Source # (/=) :: NegativeBinomialDistribution -> NegativeBinomialDistribution -> Bool Source #
DiscreteDistr NegativeBinomialDistribution Source # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods probability :: NegativeBinomialDistribution -> Int -> Double Source # logProbability :: NegativeBinomialDistribution -> Int -> Double Source #
Distribution NegativeBinomialDistribution Source # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods cumulative :: NegativeBinomialDistribution -> Double -> Double Source # complCumulative :: NegativeBinomialDistribution -> Double -> Double Source #
Entropy NegativeBinomialDistribution Source # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods entropy :: NegativeBinomialDistribution -> Double Source #
MaybeEntropy NegativeBinomialDistribution Source # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods maybeEntropy :: NegativeBinomialDistribution -> Maybe Double Source #
MaybeMean NegativeBinomialDistribution Source # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods maybeMean :: NegativeBinomialDistribution -> Maybe Double Source #
MaybeVariance NegativeBinomialDistribution Source # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods maybeVariance :: NegativeBinomialDistribution -> Maybe Double Source # maybeStdDev :: NegativeBinomialDistribution -> Maybe Double Source #
Mean NegativeBinomialDistribution Source # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods mean :: NegativeBinomialDistribution -> Double Source #
Variance NegativeBinomialDistribution Source # |
Instance details Defined in Statistics.Distribution.NegativeBinomial Methods variance :: NegativeBinomialDistribution -> Double Source # stdDev :: NegativeBinomialDistribution -> Double Source #
type Rep NegativeBinomialDistribution Source # |

Instance details

Defined in Statistics.Distribution.NegativeBinomial

type Rep NegativeBinomialDistribution = D1 ('MetaData "NegativeBinomialDistribution" "Statistics.Distribution.NegativeBinomial" "statistics-0.16.2.1-EfbCvDihUgt16PhDul7t8F" '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 Source #

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

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

Number of successes until stop

nbdProbability :: NegativeBinomialDistribution -> Double Source #

Success probability.