Bernoulli distribution
{{Short description|Probability distribution modeling a coin toss which need not be fair}}
{{Use American English|date = January 2019}}
{{Probability distribution
|name =Bernoulli distribution
|type =mass
|pdf_image =File:Bernoulli Distribution.PNG
Three examples of Bernoulli distribution:
{{legend|7F0000|2= and }}
{{legend|00007F|2= and }}
{{legend|007F00|2= and }}
|cdf_image =
|parameters =
|support =
|pdf =
q=1-p & \text{if }k=0 \\
p & \text{if }k=1
\end{cases}
|cdf =
0 & \text{if } k < 0 \\
1 - p & \text{if } 0 \leq k < 1 \\
1 & \text{if } k \geq 1
\end{cases}
|mean =
|median =
0 & \text{if } p < 1/2\\
\left[0, 1\right] & \text{if } p = 1/2\\
1 & \text{if } p > 1/2
\end{cases}
|mode =
0 & \text{if } p < 1/2\\
0, 1 & \text{if } p = 1/2\\
1 & \text{if } p > 1/2
\end{cases}
|variance =
|mad =
|skewness =
|kurtosis =
|entropy =
|mgf =
|char =
|pgf =
|fisher =|
}}
{{Probability fundamentals}}
In probability theory and statistics, the Bernoulli distribution, named after Swiss mathematician Jacob Bernoulli,{{cite book |first=James Victor |last=Uspensky |title=Introduction to Mathematical Probability |publisher=McGraw-Hill |location=New York |year=1937 |page=45 |oclc=996937 }} is the discrete probability distribution of a random variable which takes the value 1 with probability and the value 0 with probability . Less formally, it can be thought of as a model for the set of possible outcomes of any single experiment that asks a yes–no question. Such questions lead to outcomes that are Boolean-valued: a single bit whose value is success/yes/true/one with probability p and failure/no/false/zero with probability q. It can be used to represent a (possibly biased) coin toss where 1 and 0 would represent "heads" and "tails", respectively, and p would be the probability of the coin landing on heads (or vice versa where 1 would represent tails and p would be the probability of tails). In particular, unfair coins would have
The Bernoulli distribution is a special case of the binomial distribution where a single trial is conducted (so n would be 1 for such a binomial distribution). It is also a special case of the two-point distribution, for which the possible outcomes need not be 0 and 1.{{cite book |last1=Dekking |first1=Frederik |last2=Kraaikamp |first2=Cornelis |last3=Lopuhaä |first3=Hendrik |last4=Meester |first4=Ludolf |title=A Modern Introduction to Probability and Statistics |date=9 October 2010 |publisher=Springer London |isbn=9781849969529 |pages=43–48 |edition=1}}
Properties
If is a random variable with a Bernoulli distribution, then:
:
The probability mass function of this distribution, over possible outcomes k, is
:
p & \text{if }k=1, \\
q = 1-p & \text {if } k = 0.
\end{cases}{{Cite book|title=Introduction to Probability|last=Bertsekas|author-link=Dimitri Bertsekas|first=Dimitri P.|date=2002|publisher=Athena Scientific|others=Tsitsiklis, John N., Τσιτσικλής, Γιάννης Ν.|isbn=188652940X|location=Belmont, Mass.|oclc=51441829}}
This can also be expressed as
:
or as
:
The Bernoulli distribution is a special case of the binomial distribution with {{cite book | last = McCullagh | first = Peter | author-link= Peter McCullagh |author2=Nelder, John |author-link2=John Nelder | title = Generalized Linear Models, Second Edition | publisher = Boca Raton: Chapman and Hall/CRC | year = 1989 | isbn = 0-412-31760-5 |ref=McCullagh1989 |at=Section 4.2.2 }}
The kurtosis goes to infinity for high and low values of but for the two-point distributions including the Bernoulli distribution have a lower excess kurtosis, namely −2, than any other probability distribution.
The Bernoulli distributions for form an exponential family.
The maximum likelihood estimator of based on a random sample is the sample mean.
Mean
The expected value of a Bernoulli random variable is
:
This is because for a Bernoulli distributed random variable with and we find
:
Variance
The variance of a Bernoulli distributed is
:
We first find
:
:
From this follows
:
With this result it is easy to prove that, for any Bernoulli distribution, its variance will have a value inside .
Skewness
The skewness is . When we take the standardized Bernoulli distributed random variable we find that this random variable attains with probability and attains with probability . Thus we get
:
\gamma_1 &= \operatorname{E} \left[\left(\frac{X-\operatorname{E}[X]}{\sqrt{\operatorname{Var}[X]}}\right)^3\right] \\
&= p \cdot \left(\frac{q}{\sqrt{pq}}\right)^3 + q \cdot \left(-\frac{p}{\sqrt{pq}}\right)^3 \\
&= \frac{1}{\sqrt{pq}^3} \left(pq^3-qp^3\right) \\
&= \frac{pq}{\sqrt{pq}^3} (q^2-p^2) \\
&= \frac{(1-p)^2-p^2}{\sqrt{pq}} \\
&= \frac{1-2p}{\sqrt{pq}} = \frac{q-p}{\sqrt{pq}}.
\end{align}
Higher moments and cumulants
The raw moments are all equal because and .
:
The central moment of order is given by
:
\mu_k =(1-p)(-p)^k +p(1-p)^k.
The first six central moments are
:
\mu_1 &= 0, \\
\mu_2 &= p(1-p), \\
\mu_3 &= p(1-p)(1-2p), \\
\mu_4 &= p(1-p)(1-3p(1-p)), \\
\mu_5 &= p(1-p)(1-2p)(1-2p(1-p)), \\
\mu_6 &= p(1-p)(1-5p(1-p)(1-p(1-p))).
\end{align}
The higher central moments can be expressed more compactly in terms of and
:
\mu_4 &= \mu_2 (1-3\mu_2 ), \\
\mu_5 &= \mu_3 (1-2\mu_2 ), \\
\mu_6 &= \mu_2 (1-5\mu_2 (1-\mu_2 )).
\end{align}
The first six cumulants are
:
\kappa_1 &= p, \\
\kappa_2 &= \mu_2 , \\
\kappa_3 &= \mu_3 , \\
\kappa_4 &= \mu_2 (1-6\mu_2 ), \\
\kappa_5 &= \mu_3 (1-12\mu_2 ), \\
\kappa_6 &= \mu_2 (1-30\mu_2 (1-4\mu_2 )).
\end{align}
Entropy and Fisher's Information
=Entropy=
Entropy is a measure of uncertainty or randomness in a probability distribution. For a Bernoulli random variable with success probability and failure probability , the entropy is defined as:
:
H(X) &= \mathbb{E}_p \ln (\frac{1}{P(X)}) = - [P(X = 0) \ln P(X = 0) + P(X = 1) \ln P(X = 1)] \\
H(X) &= - (q \ln q + p \ln p) , \quad q = P(X = 0), p = P(X = 1)
\end{align}
The entropy is maximized when , indicating the highest level of uncertainty when both outcomes are equally likely. The entropy is zero when or , where one outcome is certain.
=Fisher's Information=
Fisher information measures the amount of information that an observable random variable carries about an unknown parameter upon which the probability of depends. For the Bernoulli distribution, the Fisher information with respect to the parameter is given by:
:
I(p) = \frac{1}{pq}
\end{align}
Proof:
- The Likelihood Function for a Bernoulli random variable is:
:
L(p; X) = p^X (1 - p)^{1 - X}
\end{align}
This represents the probability of observing given the parameter .
- The Log-Likelihood Function is:
:
\ln L(p; X) = X \ln p + (1 - X) \ln (1 - p)
\end{align}
- The Score Function (the first derivative of the log-likelihood w.r.t. is:
:
\frac{\partial}{\partial p} \ln L(p; X) = \frac{X}{p} - \frac{1 - X}{1 - p}
\end{align}
- The second derivative of the log-likelihood function is:
:
\frac{\partial^2}{\partial p^2} \ln L(p; X) = -\frac{X}{p^2} - \frac{1 - X}{(1 - p)^2}
\end{align}
- Fisher information is calculated as the negative expected value of the second derivative of the log-likelihood:
:
I(p) = -E\left[\frac{\partial^2}{\partial p^2} \ln L(p; X)\right] = -\left(-\frac{p}{p^2} - \frac{1 - p}{(1 - p)^2}\right) = \frac{1}{p(1-p)} = \frac{1}{pq}
\end{align}
It is maximized when , reflecting maximum uncertainty and thus maximum information about the parameter .
Related distributions
- If are independent, identically distributed (i.i.d.) random variables, all Bernoulli trials with success probability p, then their sum is distributed according to a binomial distribution with parameters n and p:
- : (binomial distribution).
:The Bernoulli distribution is simply , also written as
- The categorical distribution is the generalization of the Bernoulli distribution for variables with any constant number of discrete values.
- The Beta distribution is the conjugate prior of the Bernoulli distribution.{{Cite web |last1=Orloff |first1=Jeremy |last2=Bloom |first2=Jonathan |date= |title=Conjugate priors: Beta and normal |url=https://math.mit.edu/~dav/05.dir/class15-prep.pdf |access-date=October 20, 2023 |website=math.mit.edu}}
- The geometric distribution models the number of independent and identical Bernoulli trials needed to get one success.
- If , then has a Rademacher distribution.
See also
- Bernoulli process, a random process consisting of a sequence of independent Bernoulli trials
- Bernoulli sampling
- Binary entropy function
- Binary decision diagram
References
{{Reflist}}
Further reading
- {{cite book |last1=Johnson |first1=N. L. |last2=Kotz |first2=S. |last3=Kemp |first3=A. |year=1993 |title=Univariate Discrete Distributions |edition=2nd |publisher=Wiley |isbn=0-471-54897-9 }}
- {{cite book |first=John G. |last=Peatman |title=Introduction to Applied Statistics |location=New York |publisher=Harper & Row |year=1963 |pages=162–171 }}
External links
{{Commons category|Bernoulli distribution}}
- {{springer|title=Binomial distribution|id=p/b016420}}.
- {{MathWorld|title=Bernoulli Distribution|urlname=BernoulliDistribution}}
- Interactive graphic: [http://www.math.wm.edu/~leemis/chart/UDR/UDR.html Univariate Distribution Relationships].
{{ProbDistributions|discrete-finite}}
{{DEFAULTSORT:Bernoulli Distribution}}
Category:Discrete distributions