Geometric distribution

From testwiki
Jump to navigation Jump to search

Template:Short description Template:Distinguish Template:Infobox probability distribution 2 In probability theory and statistics, the geometric distribution is either one of two discrete probability distributions:

  • The probability distribution of the number X of Bernoulli trials needed to get one success, supported on ={1,2,3,};
  • The probability distribution of the number Y=X1 of failures before the first success, supported on 0={0,1,2,}.

These two different geometric distributions should not be confused with each other. Often, the name shifted geometric distribution is adopted for the former one (distribution of X); however, to avoid ambiguity, it is considered wise to indicate which is intended, by mentioning the support explicitly.

The geometric distribution gives the probability that the first occurrence of success requires k independent trials, each with success probability p. If the probability of success on each trial is p, then the probability that the k-th trial is the first success is

Pr(X=k)=(1p)k1p

for k=1,2,3,4,

The above form of the geometric distribution is used for modeling the number of trials up to and including the first success. By contrast, the following form of the geometric distribution is used for modeling the number of failures until the first success:

Pr(Y=k)=Pr(X=k+1)=(1p)kp

for k=0,1,2,3,

The geometric distribution gets its name because its probabilities follow a geometric sequence. It is sometimes called the Furry distribution after Wendell H. Furry.[1]Template:Rp

Definition

The geometric distribution is the discrete probability distribution that describes when the first success in an infinite sequence of independent and identically distributed Bernoulli trials occurs. Its probability mass function depends on its parameterization and support. When supported on , the probability mass function isP(X=k)=(1p)k1pwhere k=1,2,3, is the number of trials and p is the probability of success in each trial.[2]Template:Rp

The support may also be 0, defining Y=X1. This alters the probability mass function intoP(Y=k)=(1p)kpwhere k=0,1,2, is the number of failures before the first success.[3]Template:Rp

An alternative parameterization of the distribution gives the probability mass functionP(Y=k)=(PQ)k(1PQ)where P=1pp and Q=1p.[1]Template:Rp

An example of a geometric distribution arises from rolling a six-sided die until a "1" appears. Each roll is independent with a 1/6 chance of success. The number of rolls needed follows a geometric distribution with p=1/6.

Properties

Memorylessness

Template:Main article The geometric distribution is the only memoryless discrete probability distribution.[4] It is the discrete version of the same property found in the exponential distribution.[1]Template:Rp The property asserts that the number of previously failed trials does not affect the number of future trials needed for a success.

Because there are two definitions of the geometric distribution, there are also two definitions of memorylessness for discrete random variables.[5] Expressed in terms of conditional probability, the two definitions arePr(X>m+nX>n)=Pr(X>m),

andPr(Y>m+nYn)=Pr(Y>m),

where m and n are natural numbers, X is a geometrically distributed random variable defined over , and Y is a geometrically distributed random variable defined over 0. Note that these definitions are not equivalent for discrete random variables; Y does not satisfy the first equation and X does not satisfy the second.

Moments and cumulants

The expected value and variance of a geometrically distributed random variable X defined over is[2]Template:RpE(X)=1p,var(X)=1pp2. With a geometrically distributed random variable Y defined over 0, the expected value changes intoE(Y)=1pp,while the variance stays the same.[6]Template:Rp

For example, when rolling a six-sided die until landing on a "1", the average number of rolls needed is 11/6=6 and the average number of failures is 11/61/6=5.

The moment generating function of the geometric distribution when defined over and 0 respectively is[7][6]Template:RpMX(t)=pet1(1p)etMY(t)=p1(1p)et,t<ln(1p)The moments for the number of failures before the first success are given by

E(Yn)=k=0(1p)kpkn=pLin(1p)(for n0)

where Lin(1p) is the polylogarithm function.[8]

The cumulant generating function of the geometric distribution defined over 0 is[1]Template:Rp K(t)=lnpln(1(1p)et)The cumulants κr satisfy the recursionκr+1=qδκrδq,r=1,2,where q=1p, when defined over 0.[1]Template:Rp

Proof of expected value

Consider the expected value E(X) of X as above, i.e. the average number of trials until a success. On the first trial, we either succeed with probability p, or we fail with probability 1p. If we fail the remaining mean number of trials until a success is identical to the original mean. This follows from the fact that all trials are independent. From this we get the formula:

E(X)=pE[X|X=1]+(1p)E[X|X>1]=pE[X|X=1]+(1p)(1+E[X1|X>1])=p1+(1p)(1+E[X]),

which, if solved for E(X), gives:Template:Cn

E(X)=1p.

The expected number of failures Y can be found from the linearity of expectation, E(Y)=E(X1)=E(X)1=1p1=1pp. It can also be shown in the following way:Template:Cn

E(Y)=k=0(1p)kpk=pk=0(1p)kk=p(1p)k=0(1p)k1k=p(1p)[ddp(k=0(1p)k)]=p(1p)ddp(1p)=1pp.

The interchange of summation and differentiation is justified by the fact that convergent power series converge uniformly on compact subsets of the set of points where they converge.

Summary statistics

The mean of the geometric distribution is its expected value which is, as previously discussed in § Moments and cumulants, 1p or 1pp when defined over or 0 respectively.

The median of the geometric distribution is log2log(1p)when defined over [9] and log2log(1p) when defined over 0.[3]Template:Rp

The mode of the geometric distribution is the first value in the support set. This is 1 when defined over and 0 when defined over 0.[3]Template:Rp

The skewness of the geometric distribution is 2p1p.[6]Template:Rp

The kurtosis of the geometric distribution is 9+p21p.[6]Template:Rp The excess kurtosis of a distribution is the difference between its kurtosis and the kurtosis of a normal distribution, 3.[10]Template:Rp Therefore, the excess kurtosis of the geometric distribution is 6+p21p. Since p21p0, the excess kurtosis is always positive so the distribution is leptokurtic.[3]Template:Rp In other words, the tail of a geometric distribution decays faster than a Gaussian.[10]Template:Rp

Entropy and Fisher's Information

Entropy (Geometric Distribution, Failures Before Success)

Entropy is a measure of uncertainty in a probability distribution. For the geometric distribution that models the number of failures before the first success, the probability mass function is:

P(X=k)=(1p)kp,k=0,1,2,

The entropy H(X) for this distribution is defined as:

H(X)=k=0P(X=k)lnP(X=k)=k=0(1p)kpln((1p)kp)=k=0(1p)kp[kln(1p)+lnp]=logp1pplog(1p)

The entropy increases as the probability p decreases, reflecting greater uncertainty as success becomes rarer.

Fisher's Information (Geometric Distribution, Failures Before Success)

Fisher information measures the amount of information that an observable random variable X carries about an unknown parameter p. For the geometric distribution (failures before the first success), the Fisher information with respect to p is given by:

I(p)=1p2(1p)

Proof:

  • The Likelihood Function for a geometric random variable X is:
L(p;X)=(1p)Xp
  • The Log-Likelihood Function is:
lnL(p;X)=Xln(1p)+lnp
  • The Score Function (first derivative of the log-likelihood w.r.t. p) is:
plnL(p;X)=1pX1p
  • The second derivative of the log-likelihood function is:
2p2lnL(p;X)=1p2X(1p)2
  • Fisher Information is calculated as the negative expected value of the second derivative:
I(p)=E[2p2lnL(p;X)]=(1p21pp(1p)2)=1p2(1p)

Fisher information increases as p decreases, indicating that rarer successes provide more information about the parameter p.

Entropy (Geometric Distribution, Trials Until Success)

For the geometric distribution modeling the number of trials until the first success, the probability mass function is:

P(X=k)=(1p)k1p,k=1,2,3,

The entropy H(X) for this distribution is given by:

H(X)=k=1P(X=k)lnP(X=k)=k=1(1p)k1pln((1p)k1p)=k=1(1p)k1p[(k1)ln(1p)+lnp]=logp+1pplog(1p)

Entropy increases as p decreases, reflecting greater uncertainty as the probability of success in each trial becomes smaller.

Fisher's Information (Geometric Distribution, Trials Until Success)

Fisher information for the geometric distribution modeling the number of trials until the first success is given by:

I(p)=1p2(1p)

Proof:

  • The Likelihood Function for a geometric random variable X is:
L(p;X)=(1p)X1p
  • The Log-Likelihood Function is:
lnL(p;X)=(X1)ln(1p)+lnp
  • The Score Function (first derivative of the log-likelihood w.r.t. p) is:
plnL(p;X)=1pX11p
  • The second derivative of the log-likelihood function is:
2p2lnL(p;X)=1p2X1(1p)2
  • Fisher Information is calculated as the negative expected value of the second derivative:
I(p)=E[2p2lnL(p;X)]=(1p21pp(1p)2)=1p2(1p)

General properties

GX(s)=sp1s(1p),GY(s)=p1s(1p),|s|<(1p)1.
  • The characteristic function φ(t) is equal to G(eit) so the geometric distribution's characteristic function, when defined over and 0 respectively, is[11]Template:RpφX(t)=peit1(1p)eit,φY(t)=p1(1p)eit.
  • The entropy of a geometric distribution with parameter p is[12]plog2p+(1p)log2(1p)p
  • Given a mean, the geometric distribution is the maximum entropy probability distribution of all discrete probability distributions. The corresponding continuous distribution is the exponential distribution.[13]
  • The geometric distribution defined on 0 is infinitely divisible, that is, for any positive integer n, there exist n independent identically distributed random variables whose sum is also geometrically distributed. This is because the negative binomial distribution can be derived from a Poisson-stopped sum of logarithmic random variables.[11]Template:Rp
  • The decimal digits of the geometrically distributed random variable Y are a sequence of independent (and not identically distributed) random variables.Template:Citation needed For example, the hundreds digit D has this probability distribution:
Pr(D=d)=q100d1+q100+q200++q900,
where q = 1 − p, and similarly for the other digits, and, more generally, similarly for numeral systems with other bases than 10. When the base is 2, this shows that a geometrically distributed random variable can be written as a sum of independent random variables whose probability distributions are indecomposable.
  • The sum of r independent geometric random variables with parameter p is a negative binomial random variable with parameters r and p.[14] The geometric distribution is a special case of the negative binomial distribution, with r=1.
  • The geometric distribution is a special case of discrete compound Poisson distribution.[11]Template:Rp
  • The minimum of n geometric random variables with parameters p1,,pn is also geometrically distributed with parameter 1i=1n(1pi).[15]
  • Suppose 0 < r < 1, and for k = 1, 2, 3, ... the random variable Xk has a Poisson distribution with expected value rk/k. Then
k=1kXk
has a geometric distribution taking values in 0, with expected value r/(1 − r).Template:Citation needed
  • The exponential distribution is the continuous analogue of the geometric distribution. Applying the floor function to the exponential distribution with parameter λ creates a geometric distribution with parameter p=1eλ defined over 0.[3]Template:Rp This can be used to generate geometrically distributed random numbers as detailed in § Random variate generation.
  • If p = 1/n and X is geometrically distributed with parameter p, then the distribution of X/n approaches an exponential distribution with expected value 1 as n → ∞, sincePr(X/n>a)=Pr(X>na)=(1p)na=(11n)na=[(11n)n]a[e1]a=ea as n.More generally, if p = λ/n, where λ is a parameter, then as n→ ∞ the distribution of X/n approaches an exponential distribution with rate λ:Pr(X>nx)=limn(1λ/n)nx=eλx therefore the distribution function of X/n converges to 1eλx, which is that of an exponential random variable.Template:Cn
  • The index of dispersion of the geometric distribution is 1p and its coefficient of variation is 11p. The distribution is overdispersed.[1]Template:Rp

Statistical inference

The true parameter p of an unknown geometric distribution can be inferred through estimators and conjugate distributions.

Method of moments

Provided they exist, the first l moments of a probability distribution can be estimated from a sample x1,,xn using the formulami=1nj=1nxjiwhere mi is the ith sample moment and 1il.[16]Template:Rp Estimating E(X) with m1 gives the sample mean, denoted x¯. Substituting this estimate in the formula for the expected value of a geometric distribution and solving for p gives the estimators p^=1x¯ and p^=1x¯+1 when supported on and 0 respectively. These estimators are biased since E(1x¯)>1E(x¯)=p as a result of Jensen's inequality.[17]Template:Rp

Maximum likelihood estimation

The maximum likelihood estimator of p is the value that maximizes the likelihood function given a sample.[16]Template:Rp By finding the zero of the derivative of the log-likelihood function when the distribution is defined over , the maximum likelihood estimator can be found to be p^=1x¯, where x¯ is the sample mean.[18] If the domain is 0, then the estimator shifts to p^=1x¯+1. As previously discussed in § Method of moments, these estimators are biased.

Regardless of the domain, the bias is equal to

bE[(p^mlep)]=p(1p)n

which yields the bias-corrected maximum likelihood estimator,Template:Cn

p^mle*=p^mleb^

Bayesian inference

In Bayesian inference, the parameter p is a random variable from a prior distribution with a posterior distribution calculated using Bayes' theorem after observing samples.[17]Template:Rp If a beta distribution is chosen as the prior distribution, then the posterior will also be a beta distribution and it is called the conjugate distribution. In particular, if a Beta(α,β) prior is selected, then the posterior, after observing samples k1,,kn, is[19]pBeta(α+n, β+i=1n(ki1)).Alternatively, if the samples are in 0, the posterior distribution is[20]pBeta(α+n,β+i=1nki).Since the expected value of a Beta(α,β) distribution is αα+β,[11]Template:Rp as α and β approach zero, the posterior mean approaches its maximum likelihood estimate.

Random variate generation

Template:Further The geometric distribution can be generated experimentally from i.i.d. standard uniform random variables by finding the first such random variable to be less than or equal to p. However, the number of random variables needed is also geometrically distributed and the algorithm slows as p decreases.[21]Template:Rp

Random generation can be done in constant time by truncating exponential random numbers. An exponential random variable E can become geometrically distributed with parameter p through E/log(1p). In turn, E can be generated from a standard uniform random variable U altering the formula into log(U)/log(1p).[21]Template:Rp[22]

Applications

The geometric distribution is used in many disciplines. In queueing theory, the M/M/1 queue has a steady state following a geometric distribution.[23] In stochastic processes, the Yule Furry process is geometrically distributed.[24] The distribution also arises when modeling the lifetime of a device in discrete contexts.[25] It has also been used to fit data including modeling patients spreading COVID-19.[26]

See also

References

Template:Reflist

Template:ProbDistributions