statistics-0.15.0.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 | Haskell98

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

The discrete uniform distribution.

Instances

Eq DiscreteUniform Source # |
Instance details Defined in Statistics.Distribution.DiscreteUniform Methods (==) :: DiscreteUniform -> DiscreteUniform -> Bool Source # (/=) :: DiscreteUniform -> DiscreteUniform -> Bool Source #
Data DiscreteUniform Source # |

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

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

toConstr :: DiscreteUniform -> Constr Source #

dataTypeOf :: DiscreteUniform -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Read DiscreteUniform Source # |
Instance details Defined in Statistics.Distribution.DiscreteUniform Methods readsPrec :: Int -> ReadS DiscreteUniform Source # readList :: ReadS [DiscreteUniform] Source # readPrec :: ReadPrec DiscreteUniform Source # readListPrec :: ReadPrec [DiscreteUniform] Source #
Show DiscreteUniform Source # |
Instance details Defined in Statistics.Distribution.DiscreteUniform Methods showsPrec :: Int -> DiscreteUniform -> ShowS Source # show :: DiscreteUniform -> String Source # showList :: [DiscreteUniform] -> ShowS Source #
Generic DiscreteUniform Source # |
Instance details Defined in Statistics.Distribution.DiscreteUniform Associated Types type Rep DiscreteUniform :: Type -> Type Source # Methods from :: DiscreteUniform -> Rep DiscreteUniform x Source # to :: Rep DiscreteUniform x -> DiscreteUniform Source #
ToJSON DiscreteUniform Source # |
Instance details Defined in Statistics.Distribution.DiscreteUniform Methods toJSON :: DiscreteUniform -> Value Source # toEncoding :: DiscreteUniform -> Encoding Source # toJSONList :: [DiscreteUniform] -> Value Source # toEncodingList :: [DiscreteUniform] -> Encoding Source #
FromJSON DiscreteUniform Source # |
Instance details Defined in Statistics.Distribution.DiscreteUniform Methods parseJSON :: Value -> Parser DiscreteUniform Source # parseJSONList :: Value -> Parser [DiscreteUniform] Source #
Binary DiscreteUniform Source # |
Instance details Defined in Statistics.Distribution.DiscreteUniform Methods put :: DiscreteUniform -> Put Source # get :: Get DiscreteUniform Source # putList :: [DiscreteUniform] -> Put Source #
Entropy DiscreteUniform Source # |
Instance details Defined in Statistics.Distribution.DiscreteUniform Methods entropy :: DiscreteUniform -> Double Source #
MaybeEntropy DiscreteUniform Source # |
Instance details Defined in Statistics.Distribution.DiscreteUniform Methods maybeEntropy :: DiscreteUniform -> Maybe Double Source #
Variance DiscreteUniform Source # |
Instance details Defined in Statistics.Distribution.DiscreteUniform Methods variance :: DiscreteUniform -> Double Source # stdDev :: DiscreteUniform -> Double Source #
MaybeVariance DiscreteUniform Source # |
Instance details Defined in Statistics.Distribution.DiscreteUniform Methods maybeVariance :: DiscreteUniform -> Maybe Double Source # maybeStdDev :: DiscreteUniform -> Maybe Double Source #
Mean DiscreteUniform Source # |
Instance details Defined in Statistics.Distribution.DiscreteUniform Methods mean :: DiscreteUniform -> Double Source #
MaybeMean DiscreteUniform Source # |
Instance details Defined in Statistics.Distribution.DiscreteUniform Methods maybeMean :: DiscreteUniform -> Maybe Double Source #
DiscreteDistr DiscreteUniform Source # |
Instance details Defined in Statistics.Distribution.DiscreteUniform Methods probability :: DiscreteUniform -> Int -> Double Source # logProbability :: DiscreteUniform -> Int -> Double Source #
Distribution DiscreteUniform Source # |
Instance details Defined in Statistics.Distribution.DiscreteUniform Methods cumulative :: DiscreteUniform -> Double -> Double Source # complCumulative :: DiscreteUniform -> Double -> Double Source #
type Rep DiscreteUniform Source # |

Instance details

Defined in Statistics.Distribution.DiscreteUniform

type Rep DiscreteUniform = D1 (MetaData "DiscreteUniform" "Statistics.Distribution.DiscreteUniform" "statistics-0.15.0.0-6JZeW98TNbBJdNHw3GDX0L" 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 Source #

Arguments

:: Int | Range
-> DiscreteUniform |

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

discreteUniformAB Source #

Arguments

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

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

# Accessors

rangeFrom :: DiscreteUniform -> Int Source #

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

rangeTo :: DiscreteUniform -> Int Source #

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