statistics v0.4.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)

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

Functions

cdf(n, p)

The cumulative density function

Examples

iex> Statistics.Distributions.Binomial.cdf(4, 0.5).(2)
0.6875
pmf(n, p)

Specs

pmf(non_neg_integer, number) :: (... -> any)

The probability mass function

Examples

iex> Statistics.Distributions.Binomial.pmf(4, 0.5).(2)
0.375
ppf(n, p)

Specs

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
rand(n, p)

Specs

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