Statistics.Distributions.Hypergeometric (statistics v0.6.3)
Hypergeometric distribution.
It models the probability that an n numbers of trials result in exactly k successes, with a population of pn items, where pk are considered as successes.
Summary
Functions
The cumulative density function
The probability mass function
The percentile-point function
Draw a random number from hypergeometric distribution
Functions
Link to this function
cdf(pn, pk, n)
@spec cdf(non_neg_integer(), non_neg_integer(), non_neg_integer()) :: (... -> any())
The cumulative density function
Examples
iex> Statistics.Distributions.Hypergeometric.cdf(52, 5, 13).(2)
0.9072328931572629
Link to this function
pmf(pn, pk, n)
@spec pmf(non_neg_integer(), non_neg_integer(), non_neg_integer()) :: (... -> any())
The probability mass function
Examples
iex> Statistics.Distributions.Hypergeometric.pmf(50, 5, 10).(4)
0.003964583058015066
Link to this function
ppf(pn, pk, n)
@spec ppf(non_neg_integer(), non_neg_integer(), non_neg_integer()) :: (... -> any())
The percentile-point function
Examples
iex> Statistics.Distributions.Hypergeometric.ppf(80, 20, 50).(0.1)
10
Link to this function
rand(pn, pk, n)
@spec rand(non_neg_integer(), non_neg_integer(), non_neg_integer()) :: non_neg_integer()
Draw a random number from hypergeometric distribution