Statistics.Distribution.DiscreteUniform

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

Copyright | (c) 2016 André Szabolcs Szelp
License | BSD3
Maintainer | a.sz.szelp@gmail.com
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Statistics.Distribution.DiscreteUniform

Contents

- Constructors
- Accessors

Description

The discrete uniform distribution. There are two parametrizations of this distribution. First is the probability distribution on an inclusive interval {1, ..., n}. This is parametrized with n only, where p_1, ..., p_n = 1/n. (`discreteUniform`).

The second parametrization is the uniform distribution on {a, ..., b} with probabilities p_a, ..., p_b = 1/(a-b+1). This is parametrized with a and b. (`discreteUniformAB`)

Synopsis

- data DiscreteUniform
- discreteUniform :: Int -> DiscreteUniform
- discreteUniformAB :: Int -> Int -> DiscreteUniform
- rangeFrom :: DiscreteUniform -> Int
- rangeTo :: DiscreteUniform -> Int

# Documentation

data DiscreteUniform #

The discrete uniform distribution.

#### Instances

Instances details

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

# Constructors

discreteUniform #

Arguments

:: Int | Range
-> DiscreteUniform |

Construct discrete uniform distribution on support {1, ..., n}. Range n must be >0.

discreteUniformAB #

Arguments

:: Int | Lower boundary (inclusive)
-> Int | Upper boundary (inclusive)
-> DiscreteUniform |

Construct discrete uniform distribution on support {a, ..., b}.

# Accessors

rangeFrom :: DiscreteUniform -> Int #

a, the lower bound of the support {a, ..., b}

rangeTo :: DiscreteUniform -> Int #

b, the upper bound of the support {a, ..., b}