statistics v0.5.0 Statistics.Distributions.Binomial

Binomial distribution.

This models the expected outcome of a number of binary trials, each with known probability, (often called a Bernoulli trial)

Link to this section Summary

Functions

The cumulative density function

The probability mass function

The percentile-point function

Draw a random number from a t distribution with specified degrees of freedom

Link to this section Functions

The cumulative density function

Examples

iex> Statistics.Distributions.Binomial.cdf(4, 0.5).(2)
0.6875
Link to this function pmf(n, p)
pmf(non_neg_integer(), number()) :: (... -> any())

The probability mass function

Examples

iex> Statistics.Distributions.Binomial.pmf(4, 0.5).(2)
0.375
Link to this function ppf(n, p)
ppf(non_neg_integer(), number()) :: (... -> any())
ppf(non_neg_integer(), number()) :: (... -> any())

The percentile-point function

Examples

iex> Statistics.Distributions.Binomial.ppf(10, 0.5).(0.5)
5
Link to this function rand(n, p)
rand(non_neg_integer(), number()) :: non_neg_integer()

Draw a random number from a t distribution with specified degrees of freedom

Uses the rejection sampling method

Examples

iex> Statistics.Distributions.Binomial.rand(10, 0.5)
5.0