Bernoulli distribution

From HandWiki
Short description: Probability distribution modeling a coin toss which need not be fair
Bernoulli distribution
Probability mass function
Funzione di densità di una variabile casuale normale

Three examples of Bernoulli distribution:

  P(x=0)=0.2 and P(x=1)=0.8
  P(x=0)=0.8 and P(x=1)=0.2
  P(x=0)=0.5 and P(x=1)=0.5
Parameters

0≤p≤1

q=1−p
Support k∈{0,1}
pmf {q=1−pif k=0pif k=1
CDF {0if k<01−pif 0≤k<11if k≥1
Mean p
Median {0if p<1/2[0,1]if p=1/21if p>1/2
Mode {0if p<1/20,1if p=1/21if p>1/2
Variance p(1−p)=pq
Skewness q−ppq
Kurtosis 1−6pqpq
Entropy −qln⁡q−pln⁡p
MGF q+pet
CF q+peit
PGF q+pz
Fisher information 1pq

In probability theory and statistics, the Bernoulli distribution, named after Swiss mathematician Jacob Bernoulli,[1] is the discrete probability distribution of a random variable which takes the value 1 with probability p and the value 0 with probability q=1−p. 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 p≠1/2.

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.[2]

Properties

If X is a random variable with a Bernoulli distribution, then:

Pr⁡(X=1)=p,Pr⁡(X=0)=q=1−p.

The probability mass function f of this distribution, over possible outcomes k, is[3]

f(k;p)={pif k=1,q=1−pif k=0.

This can also be expressed as

f(k;p)=pk(1−p)1−kfor k∈{0,1}

or as

f(k;p)=pk+(1−p)(1−k)for k∈{0,1}.

The Bernoulli distribution is a special case of the binomial distribution with n=1.[4]

The kurtosis goes to infinity for high and low values of p, but for p=1/2 the two-point distributions including the Bernoulli distribution have a lower excess kurtosis, namely −2, than any other probability distribution.

The Bernoulli distributions for 0≤p≤1 form an exponential family.

The maximum likelihood estimator of p based on a random sample is the sample mean.

The probability mass distribution function of a Bernoulli experiment along with its corresponding cumulative distribution function

Mean

The expected value of a Bernoulli random variable X is

E⁡[X]=p

This is because for a Bernoulli distributed random variable X with Pr⁡(X=1)=p and Pr⁡(X=0)=q we find[3]

E⁡[X]=Pr⁡(X=1)⋅1+Pr⁡(X=0)⋅0=p⋅1+q⋅0=p.

Variance

The variance of a Bernoulli distributed X is

Var⁡[X]=pq=p(1−p)

We first find

E⁡[X2]=Pr⁡(X=1)⋅12+Pr⁡(X=0)⋅02=p⋅12+q⋅02=p=E⁡[X]

From this follows[3]

Var⁡[X]=E⁡[X2]−E⁡[X]2=E⁡[X]−E⁡[X]2=p−p2=p(1−p)=pq

With this result it is easy to prove that, for any Bernoulli distribution, its variance will have a value inside [0,1/4].

Skewness

The skewness is q−ppq=1−2ppq. When we take the standardized Bernoulli distributed random variable X−E⁡[X]Var⁡[X] we find that this random variable attains qpq with probability p and attains −ppq with probability q. Thus we get

γ1=E⁡[(X−E⁡[X]Var⁡[X])3]=p⋅(qpq)3+q⋅(−ppq)3=1pq3(pq3−qp3)=pqpq3(q2−p2)=(1−p)2−p2pq=1−2ppq=q−ppq.

Higher moments and cumulants

The raw moments are all equal because 1k=1 and 0k=0.

E⁡[Xk]=Pr⁡(X=1)⋅1k+Pr⁡(X=0)⋅0k=p⋅1+q⋅0=p=E⁡[X].

The central moment of order k is given by μk=(1−p)(−p)k+p(1−p)k. The first six central moments are μ1=0,μ2=p(1−p),μ3=p(1−p)(1−2p),μ4=p(1−p)(1−3p(1−p)),μ5=p(1−p)(1−2p)(1−2p(1−p)),μ6=p(1−p)(1−5p(1−p)(1−p(1−p))). The higher central moments can be expressed more compactly in terms of μ2 and μ3 μ4=μ2(1−3μ2),μ5=μ3(1−2μ2),μ6=μ2(1−5μ2(1−μ2)). The first six cumulants are κ1=p,κ2=μ2,κ3=μ3,κ4=μ2(1−6μ2),κ5=μ3(1−12μ2),κ6=μ2(1−30μ2(1−4μ2)).

Entropy and Fisher's Information

Entropy

Entropy is a measure of uncertainty or randomness in a probability distribution. For a Bernoulli random variable X with success probability p and failure probability q=1−p, the entropy H(X) is defined as:

H(X)=𝔼pln⁡1Pr⁡(X)=−Pr⁡(X=0)ln⁡Pr⁡(X=0)−Pr⁡(X=1)ln⁡Pr⁡(X=1)=−(qln⁡q+pln⁡p).

The entropy is maximized when p=0.5, indicating the highest level of uncertainty when both outcomes are equally likely. The entropy is zero when p=0 or p=1, where one outcome is certain.

Fisher's Information

Fisher information measures the amount of information that an observable random variable X carries about an unknown parameter p upon which the probability of X depends. For the Bernoulli distribution, the Fisher information with respect to the parameter p is given by:

I(p)=1pq

Proof:

  • The Likelihood Function for a Bernoulli random variableX is: L(p;X)=pX(1−p)1−X This represents the probability of observing X given the parameter p.
  • The Log-Likelihood Function is: ln⁡L(p;X)=Xln⁡p+(1−X)ln⁡(1−p)
  • The Score Function (the first derivative of the log-likelihood with respect to p is: ∂∂pln⁡L(p;X)=Xp−1−X1−p
  • The second derivative of the log-likelihood function is: ∂2∂p2ln⁡L(p;X)=−Xp2−1−X(1−p)2
  • Fisher information is calculated as the negative expected value of the second derivative of the log-likelihood:I(p)=−E[∂2∂p2ln⁡L(p;X)]=−(−pp2−1−p(1−p)2)=1p(1−p)=1pq

It is maximized when p=0.5, reflecting maximum uncertainty and thus maximum information about the parameter p.

The Bernoulli distribution is simply B⁡(1,p), also written as Bernoulli(p).

See also

References

  1. ↑ Uspensky, James Victor (1937). Introduction to Mathematical Probability. New York: McGraw-Hill. p. 45. OCLC 996937. 
  2. ↑ Dekking, Frederik; Kraaikamp, Cornelis; Lopuhaä, Hendrik; Meester, Ludolf (9 October 2010). A Modern Introduction to Probability and Statistics (1 ed.). Springer London. pp. 43–48. ISBN 9781849969529. 
  3. ↑ 3.0 3.1 3.2 3.3 Bertsekas, Dimitri P. (2002). Introduction to Probability. Tsitsiklis, John N., Τσιτσικλής, Γιάννης Ν.. Belmont, Mass.: Athena Scientific. ISBN 188652940X. OCLC 51441829. 
  4. ↑ McCullagh, Peter; Nelder, John (1989). Generalized Linear Models, Second Edition. Boca Raton: Chapman and Hall/CRC. Section 4.2.2. ISBN 0-412-31760-5. 
  5. ↑ Orloff, Jeremy; Bloom, Jonathan. "Conjugate priors: Beta and normal". https://math.mit.edu/~dav/05.dir/class15-prep.pdf. 

Further reading

  • Johnson, Norman L.; Kotz, Samuel; Kemp, Adrienne W. (1993). Univariate Discrete Distributions (2nd ed.). Wiley. ISBN 0-471-54897-9. 
  • Peatman, John G. (1963). Introduction to Applied Statistics. New York: Harper & Row. pp. 162–171.