Bernoulli Distribution#

Univariate, Discrete, Bounded, Non-Negative

The Bernoulli distribution is a discrete probability distribution. It can be thought of as a model for the set of possible outcomes of any single experiment that asks a yes–no question. More formally, it is a random variable which takes the value 1 with probability \(p\) and the value 0 with probability \(q = 1 − p\).

Key properties and parameters#

Support

\(x \in \{0, 1\}\)

Mean

\(p\)

Variance

\(p (1 - p)\)

Parameters:

  • \(p\) : (float) Probability of success, \(0 \leq p \leq 1\).

  • \(\text{logit}(p)\) : (float) Alternative log odds for the probability success, \(-\infty < \text{logit}(p) < \infty\).

Alternative parametrization

The Bernoulli distribution has 2 alternative parametrizations. In terms of \(p\) or \(\text{logit}(p)\).

The link between the 2 alternatives is given by

\[ \text{logit}(p) = \log(\frac{p}{1-p}) \]

Probability Mass Function (PMF)#

\[ f(x \mid p) = p^{x} (1-p)^{1-x} \]
../../_images/bernoulli_0_0.png
../../_images/bernoulli_1_0.png

Cumulative Distribution Function (CDF)#

\[\begin{split} F(x \mid p) = \begin{cases} 0 & \text{if } k < 0 \\ 1 - p & \text{if } 0 \leq k < 1 \\ 1 & \text{if } k \geq 1 \end{cases} \end{split}\]
../../_images/bernoulli_2_0.png
../../_images/bernoulli_3_0.png

See also

Related Distributions:

  • Binomial - The Bernoulli distribution is a special case of the Binomial distribution with \(N=1\).

  • Categorical - A generalization of the Bernoulli distribution to more than two outcomes.

References#