geometric distribution

{{short description|Probability distribution}}

{{Distinguish|Hypergeometric distribution}}

{{Infobox probability distribution 2

| name = Geometric

| type = mass

| pdf_image = 300px

| cdf_image = 300px

| parameters = 0 < p \leq 1 success probability (real)

| support = k trials where k \in \mathbb{N} = \{1, 2, 3, \dotsc\}

| pdf = (1 - p)^{k-1}p

| cdf = 1-(1 - p)^{\lfloor x\rfloor} for x\geq 1,
0 for x<1

| mean = \frac{1}{p}

| median = \left\lceil \frac{-1}{\log_2(1-p)} \right\rceil

(not unique if -1/\log_2(1-p) is an integer)

| mode = 1

| variance = \frac{1-p}{p^2}

| skewness = \frac{2-p}{\sqrt{1-p}}

| kurtosis = 6+\frac{p^2}{1-p}

| entropy = \tfrac{-(1-p)\log (1-p) - p \log p}{p}

| fisher = \tfrac{1}{p^2 \cdot(1-p)}

| mgf = \frac{pe^t}{1-(1-p) e^t},
for t<-\ln(1-p)

| char = \frac{pe^{it}}{1-(1-p)e^{it}}

| pgf = \frac{pz}{1-(1-p)z}

| parameters2 = 0 < p \leq 1 success probability (real)

| support2 = k failures where k \in \mathbb{N}_0 = \{0, 1, 2, \dotsc\}

| pdf2 = (1 - p)^k p

| cdf2 = 1-(1 - p)^{\lfloor x\rfloor+1} for x\geq 0,
0 for x<0

| mean2 = \frac{1-p}{p}

| median2 = \left\lceil \frac{-1}{\log_2(1-p)} \right\rceil - 1

(not unique if -1/\log_2(1-p) is an integer)

| mode2 = 0

| variance2 = \frac{1-p}{p^2}

| skewness2 = \frac{2-p}{\sqrt{1-p}}

| kurtosis2 = 6+\frac{p^2}{1-p}

| entropy2 = \tfrac{-(1-p)\log (1-p) - p \log p}{p}

| fisher2 = \tfrac{1}{p^2 \cdot(1-p)}

| mgf2 = \frac{p}{1-(1-p)e^t},
for t<-\ln(1-p)

| char2 = \frac{p}{1-(1-p)e^{it}}

| pgf2 = \frac{p}{1-(1-p)z}

}}

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 \mathbb{N} = \{1,2,3,\ldots\};
  • The probability distribution of the number Y=X-1 of failures before the first success, supported on \mathbb{N}_0 = \{0, 1, 2, \ldots \} .

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) = (1-p)^{k-1}p

for k=1,2,3,4,\dots

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)= (1 - p)^k p

for k=0,1,2,3,\dots

The geometric distribution gets its name because its probabilities follow a geometric sequence. It is sometimes called the Furry distribution after Wendell H. Furry.{{Rp|page=210}}

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 \mathbb{N}, the probability mass function is P(X = k) = (1 - p)^{k-1} p where k = 1, 2, 3, \dotsc is the number of trials and p is the probability of success in each trial.{{Cite book |last1=Nagel |first1=Werner |url=https://onlinelibrary.wiley.com/doi/book/10.1002/9781119243496 |title=Probability and Conditional Expectation: Fundamentals for the Empirical Sciences |last2=Steyer |first2=Rolf |date=2017-04-04 |publisher=Wiley |isbn=978-1-119-24352-6 |edition=1st |series=Wiley Series in Probability and Statistics |pages= |language=en |doi=10.1002/9781119243496}}{{Rp|pages=260–261}}

The support may also be \mathbb{N}_0, defining Y=X-1. This alters the probability mass function into P(Y = k) = (1 - p)^k p where k = 0, 1, 2, \dotsc is the number of failures before the first success.{{Cite book |last1=Chattamvelli |first1=Rajan |url=https://link.springer.com/10.1007/978-3-031-02425-2 |title=Discrete Distributions in Engineering and the Applied Sciences |last2=Shanmugam |first2=Ramalingam |publisher=Springer International Publishing |year=2020 |isbn=978-3-031-01297-6 |series=Synthesis Lectures on Mathematics & Statistics |location=Cham |language=en |doi=10.1007/978-3-031-02425-2}}{{Rp|page=66}}

An alternative parameterization of the distribution gives the probability mass function P(Y = k) = \left(\frac{P}{Q}\right)^k \left(1-\frac{P}{Q}\right) where P = \frac{1-p}{p} and Q = \frac{1}{p}.{{Rp|pages=208–209}}

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 =

{{Main article|Memorylessness}}

The geometric distribution is the only memoryless discrete probability distribution.{{Cite book |last1=Dekking |first1=Frederik Michel |url=http://link.springer.com/10.1007/1-84628-168-7 |title=A Modern Introduction to Probability and Statistics |last2=Kraaikamp |first2=Cornelis |last3=Lopuhaä |first3=Hendrik Paul |last4=Meester |first4=Ludolf Erwin |date=2005 |publisher=Springer London |isbn=978-1-85233-896-1 |series=Springer Texts in Statistics |location=London |page=50 |language=en |doi=10.1007/1-84628-168-7}} It is the discrete version of the same property found in the exponential distribution.{{Cite book |last1=Johnson |first1=Norman L. |url=https://onlinelibrary.wiley.com/doi/book/10.1002/0471715816 |title=Univariate Discrete Distributions |last2=Kemp |first2=Adrienne W.|author2-link=Adrienne W. Kemp |last3=Kotz |first3=Samuel |date=2005-08-19 |publisher=Wiley |isbn=978-0-471-27246-5 |edition=1 |series=Wiley Series in Probability and Statistics |page= |language=en |doi=10.1002/0471715816}}{{Rp|page=228}} 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.{{Cite web |last=Weisstein |first=Eric W. |title=Memoryless |url=https://mathworld.wolfram.com/ |access-date=2024-07-25 |website=mathworld.wolfram.com |language=en}} Expressed in terms of conditional probability, the two definitions are\Pr(X>m+n\mid X>n)=\Pr(X>m),

and\Pr(Y>m+n\mid Y\geq n)=\Pr(Y>m),

where m and n are natural numbers, X is a geometrically distributed random variable defined over \mathbb{N}, and Y is a geometrically distributed random variable defined over \mathbb{N}_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 \mathbb{N} is{{Rp|page=261}}\operatorname{E}(X) = \frac{1}{p},

\qquad\operatorname{var}(X) = \frac{1-p}{p^2}. With a geometrically distributed random variable Y defined over \mathbb{N}_0, the expected value changes into\operatorname{E}(Y) = \frac{1-p} p,while the variance stays the same.{{Cite book |last1=Forbes |first1=Catherine |url=https://onlinelibrary.wiley.com/doi/book/10.1002/9780470627242 |title=Statistical Distributions |last2=Evans |first2=Merran |last3=Hastings |first3=Nicholas |last4=Peacock |first4=Brian |date=2010-11-29 |publisher=Wiley |isbn=978-0-470-39063-4 |edition=1st |pages= |language=en |doi=10.1002/9780470627242}}{{Rp|pages=114–115}}

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

The moment generating function of the geometric distribution when defined over

\mathbb{N}

and \mathbb{N}_0 respectively is{{Cite book |last1=Bertsekas |first1=Dimitri P. |url=https://archive.org/details/introductiontopr0000bert_p5i9_2ndedi |title=Introduction to probability |last2=Tsitsiklis |first2=John N. |publisher=Athena Scientific |year=2008 |isbn=978-1-886529-23-6 |edition=2nd |series=Optimization and computation series |location=Belmont |page=235 |language=en}}{{Rp|page=114}}\begin{align}

M_X(t) &= \frac{pe^t}{1-(1-p)e^t} \\

M_Y(t) &= \frac{p}{1-(1-p)e^t}, t < -\ln(1-p)

\end{align}The moments for the number of failures before the first success are given by

:

\begin{align}

\mathrm{E}(Y^n) & {} =\sum_{k=0}^\infty (1-p)^k p\cdot k^n \\

& {} =p \operatorname{Li}_{-n}(1-p) & (\text{for }n \neq 0)

\end{align}

where \operatorname{Li}_{-n}(1-p) is the polylogarithm function.{{Cite web |last=Weisstein |first=Eric W. |title=Geometric Distribution |url=https://mathworld.wolfram.com/ |access-date=2024-07-13 |website=MathWorld |language=en}}

The cumulant generating function of the geometric distribution defined over \mathbb{N}_0 is{{Rp|page=216}} K(t) = \ln p - \ln (1 - (1-p)e^t)The cumulants \kappa_r satisfy the recursion\kappa_{r+1} = q \frac{\delta\kappa_r}{\delta q}, r=1,2,\dotscwhere q = 1-p, when defined over \mathbb{N}_0.{{Rp|page=216}}

== Proof of expected value ==

Consider the expected value \mathrm{E}(X) of X as above, i.e. the average number of trials until a success.

The first trial either succeeds with probability p, or fails with probability 1-p.

If it fails, 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:

: \operatorname \mathrm{E}(X) = p + (1-p)(1 + \mathrm{E}[X]) ,

which, when solved for \mathrm{E}(X) , gives:

: \operatorname E(X) = \frac{1}{p}.

The expected number of failures Y can be found from the linearity of expectation, \mathrm{E}(Y) = \mathrm{E}(X-1) = \mathrm{E}(X) - 1 = \frac 1 p - 1 = \frac{1-p}{p}. It can also be shown in the following way:

:

\begin{align}

\operatorname E(Y) & =p\sum_{k=0}^\infty(1-p)^k k \\

& = p (1-p) \sum_{k=0}^\infty (1-p)^{k-1} k\\

& = p (1-p) \left(-\sum_{k=0}^\infty \frac{d}{dp}\left[(1-p)^k\right]\right) \\

& = p (1-p) \left[\frac{d}{dp}\left(-\sum_{k=0}^\infty (1-p)^k\right)\right] \\

& = p(1-p)\frac{d}{dp}\left(-\frac{1}{p}\right) \\

& = \frac{1-p}{p}.

\end{align}

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, \frac{1}{p} or \frac{1-p}{p} when defined over \mathbb{N} or \mathbb{N}_0 respectively.

The median of the geometric distribution is \left\lceil -\frac{\log 2}{\log(1-p)} \right\rceilwhen defined over \mathbb{N}{{Cite book |last=Aggarwal |first=Charu C. |url=https://link.springer.com/10.1007/978-3-031-53282-5 |title=Probability and Statistics for Machine Learning: A Textbook |publisher=Springer Nature Switzerland |year=2024 |isbn=978-3-031-53281-8 |location=Cham |page=138 |language=en |doi=10.1007/978-3-031-53282-5}} and \left\lfloor-\frac{\log 2}{\log(1-p)}\right\rfloor when defined over \mathbb{N}_0.{{Rp|page=69}}

The mode of the geometric distribution is the first value in the support set. This is 1 when defined over \mathbb{N} and 0 when defined over \mathbb{N}_0.{{Rp|page=69}}

The skewness of the geometric distribution is \frac{2-p}{\sqrt{1-p}}.{{Rp|pages=|page=115}}

The kurtosis of the geometric distribution is 9 + \frac{p^2}{1-p}.{{Rp|pages=|page=115}} The excess kurtosis of a distribution is the difference between its kurtosis and the kurtosis of a normal distribution, 3.{{Cite book |last=Chan |first=Stanley |url=https://probability4datascience.com/ |title=Introduction to Probability for Data Science |publisher=Michigan Publishing |year=2021 |isbn=978-1-60785-747-1 |edition=1st |language=en}}{{Rp|pages=|page=217}} Therefore, the excess kurtosis of the geometric distribution is 6 + \frac{p^2}{1-p}. Since \frac{p^2}{1-p} \geq 0, the excess kurtosis is always positive so the distribution is leptokurtic.{{Rp|page=69}} In other words, the tail of a geometric distribution decays faster than a Gaussian.{{Rp|pages=|page=217}}

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) = (1 - p)^k p, \quad k = 0, 1, 2, \dots

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

:\begin{align}

H(X) &= - \sum_{k=0}^{\infty} P(X = k) \ln P(X = k) \\

&= - \sum_{k=0}^{\infty} (1 - p)^k p \ln \left( (1 - p)^k p \right) \\

&= - \sum_{k=0}^{\infty} (1 - p)^k p \left[ k \ln(1 - p) + \ln p \right] \\

&= -\log p - \frac{1 - p}{p} \log(1 - p)

\end{align}

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) = \frac{1}{p^2(1 - p)}

Proof:

  • The Likelihood Function for a geometric random variable X is:

:L(p; X) = (1 - p)^X p

  • The Log-Likelihood Function is:

:\ln L(p; X) = X \ln(1 - p) + \ln p

  • The Score Function (first derivative of the log-likelihood w.r.t. p) is:

:\frac{\partial}{\partial p} \ln L(p; X) = \frac{1}{p} - \frac{X}{1 - p}

  • The second derivative of the log-likelihood function is:

:\frac{\partial^2}{\partial p^2} \ln L(p; X) = -\frac{1}{p^2} - \frac{X}{(1 - p)^2}

  • Fisher Information is calculated as the negative expected value of the second derivative:

:\begin{align}

I(p) &= -E\left[\frac{\partial^2}{\partial p^2} \ln L(p; X)\right] \\

&= - \left(-\frac{1}{p^2} - \frac{1 - p}{p (1 - p)^2} \right) \\

&= \frac{1}{p^2(1 - p)}

\end{align}

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) = (1 - p)^{k - 1} p, \quad k = 1, 2, 3, \dots

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

:\begin{align}

H(X) &= - \sum_{k=1}^{\infty} P(X = k) \ln P(X = k) \\

&= - \sum_{k=1}^{\infty} (1 - p)^{k - 1} p \ln \left( (1 - p)^{k - 1} p \right) \\

&= - \sum_{k=1}^{\infty} (1 - p)^{k - 1} p \left[ (k - 1) \ln(1 - p) + \ln p \right] \\

&= - \log p + \frac{1 - p}{p} \log(1 - p)

\end{align}

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) = \frac{1}{p^2(1 - p)}

Proof:

  • The Likelihood Function for a geometric random variable X is:

:L(p; X) = (1 - p)^{X - 1} p

  • The Log-Likelihood Function is:

:\ln L(p; X) = (X - 1) \ln(1 - p) + \ln p

  • The Score Function (first derivative of the log-likelihood w.r.t. p) is:

:\frac{\partial}{\partial p} \ln L(p; X) = \frac{1}{p} - \frac{X - 1}{1 - p}

  • The second derivative of the log-likelihood function is:

:\frac{\partial^2}{\partial p^2} \ln L(p; X) = -\frac{1}{p^2} - \frac{X - 1}{(1 - p)^2}

  • Fisher Information is calculated as the negative expected value of the second derivative:

:\begin{align}

I(p) &= -E\left[\frac{\partial^2}{\partial p^2} \ln L(p; X)\right] \\

&= - \left(-\frac{1}{p^2} - \frac{1 - p}{p (1 - p)^2} \right) \\

&= \frac{1}{p^2(1 - p)}

\end{align}

= General properties =

X

and

Y

defined over

\mathbb{N}

and

\mathbb{N}_0

are, respectively,{{Rp|pages=114–115}}

::\begin{align}

G_X(s) & = \frac{s\,p}{1-s\,(1-p)}, \\[10pt]

G_Y(s) & = \frac{p}{1-s\,(1-p)}, \quad |s| < (1-p)^{-1}.

\end{align}

  • The characteristic function \varphi(t) is equal to G(e^{it}) so the geometric distribution's characteristic function, when defined over

\mathbb{N}

and

\mathbb{N}_0

respectively, is{{Cite book |url=http://link.springer.com/10.1007/978-3-642-04898-2 |title=International Encyclopedia of Statistical Science |publisher=Springer Berlin Heidelberg |year=2011 |isbn=978-3-642-04897-5 |editor-last=Lovric |editor-first=Miodrag |edition=1st |location=Berlin, Heidelberg |language=en |doi=10.1007/978-3-642-04898-2}}{{Rp|page=1630}}\begin{align}

\varphi_X(t) &= \frac{pe^{it}}{1-(1-p)e^{it}},\\[10pt]

\varphi_Y(t) &= \frac{p}{1-(1-p)e^{it}}.

\end{align}

  • The entropy of a geometric distribution with parameter p is-\frac{p \log_2 p + (1-p) \log_2 (1-p)}{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.{{Cite journal |last1=Lisman |first1=J. H. C. |last2=Zuylen |first2=M. C. A. van |date=March 1972 |title=Note on the generation of most probable frequency distributions |url=https://onlinelibrary.wiley.com/doi/10.1111/j.1467-9574.1972.tb00152.x |journal=Statistica Neerlandica |language=en |volume=26 |issue=1 |pages=19–23 |doi=10.1111/j.1467-9574.1972.tb00152.x |issn=0039-0402}}
  • The geometric distribution defined on

\mathbb{N}_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.{{Rp|pages=606–607}}

  • The decimal digits of the geometrically distributed random variable Y are a sequence of independent (and not identically distributed) random variables.{{citation needed|date=May 2012}} For example, the hundreds digit D has this probability distribution:

::\Pr(D=d) = {q^{100d} \over 1 + q^{100} + q^{200} + \cdots + q^{900}},

: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.

  • Golomb coding is the optimal prefix code{{clarify|date=May 2012}} for the geometric discrete distribution.{{Cite journal|last1=Gallager|first1=R.|last2=van Voorhis|first2=D.|date=March 1975|title=Optimal source codes for geometrically distributed integer alphabets (Corresp.)|journal=IEEE Transactions on Information Theory|volume=21|issue=2|pages=228–230|doi=10.1109/TIT.1975.1055357|issn=0018-9448}}

Related distributions

  • The sum of r independent geometric random variables with parameter p is a negative binomial random variable with parameters r and p.{{Cite book |last=Pitman |first=Jim |url=http://link.springer.com/10.1007/978-1-4612-4374-8 |title=Probability |date=1993 |publisher=Springer New York |isbn=978-0-387-94594-1 |location=New York, NY |page=372 |language=en |doi=10.1007/978-1-4612-4374-8}} 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.{{Rp|page=606}}
  • The minimum of n geometric random variables with parameters p_1, \dotsc, p_n is also geometrically distributed with parameter 1 - \prod_{i=1}^n (1-p_i).{{cite journal |last1=Ciardo |first1=Gianfranco |last2=Leemis |first2=Lawrence M. |last3=Nicol |first3=David |date=1 June 1995 |title=On the minimum of independent geometrically distributed random variables |url=https://dx.doi.org/10.1016/0167-7152%2894%2900130-Z |journal=Statistics & Probability Letters |language=en |volume=23 |issue=4 |pages=313–326 |doi=10.1016/0167-7152(94)00130-Z |s2cid=1505801 |hdl-access=free |hdl=2060/19940028569}}
  • Suppose 0 < r < 1, and for k = 1, 2, 3, ... the random variable Xk has a Poisson distribution with expected value rk/k. Then

::\sum_{k=1}^\infty k\,X_k

:has a geometric distribution taking values in \mathbb{N}_0, with expected value r/(1 − r).{{citation needed|date=May 2012}}

  • The exponential distribution is the continuous analogue of the geometric distribution. Applying the floor function to the exponential distribution with parameter \lambda creates a geometric distribution with parameter p=1-e^{-\lambda} defined over \mathbb{N}_0.{{Rp|page=74}} 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 → ∞, since

\begin{align}

\Pr(X/n>a)=\Pr(X>na) & = (1-p)^{na} = \left(1-\frac 1 n \right)^{na} = \left[ \left( 1-\frac 1 n \right)^n \right]^{a} \\

& \to [e^{-1}]^{a} = e^{-a} \text{ as } n\to\infty.

\end{align}

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)=\lim_{n \to \infty}(1-\lambda /n)^{nx}=e^{-\lambda x} therefore the distribution function of X/n converges to 1-e^{-\lambda x}, which is that of an exponential random variable.{{Cn|date=July 2024}}

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 x_1, \dotsc, x_n using the formulam_i = \frac{1}{n} \sum_{j=1}^n x^i_jwhere m_i is the ith sample moment and 1 \leq i \leq l.{{Cite book |last1=Evans |first1=Michael |url=https://www.utstat.toronto.edu/mikevans/jeffrosenthal/ |title=Probability and Statistics: The Science of Uncertainty |last2=Rosenthal |first2=Jeffrey |year=2023 |isbn=978-1429224628 |edition=2nd |pages= |publisher=Macmillan Learning |language=en}}{{Rp|pages=349–350}} Estimating \mathrm{E}(X) with m_1 gives the sample mean, denoted

\bar{x}

. Substituting this estimate in the formula for the expected value of a geometric distribution and solving for

p

gives the estimators

\hat{p} = \frac{1}{\bar{x}}

and

\hat{p} = \frac{1}{\bar{x}+1}

when supported on \mathbb{N} and \mathbb{N}_0 respectively. These estimators are biased since \mathrm{E}\left(\frac{1}{\bar{x}}\right) > \frac{1}{\mathrm{E}(\bar{x})} = p as a result of Jensen's inequality.{{Cite book |last1=Held |first1=Leonhard |url=https://link.springer.com/10.1007/978-3-662-60792-3 |title=Likelihood and Bayesian Inference: With Applications in Biology and Medicine |last2=Sabanés Bové |first2=Daniel |date=2020 |publisher=Springer Berlin Heidelberg |isbn=978-3-662-60791-6 |series=Statistics for Biology and Health |location=Berlin, Heidelberg |language=en |doi=10.1007/978-3-662-60792-3}}{{Rp|pages=53–54}}

= Maximum likelihood estimation =

The maximum likelihood estimator of p is the value that maximizes the likelihood function given a sample.{{Rp|page=308}} By finding the zero of the derivative of the log-likelihood function when the distribution is defined over \mathbb{N}, the maximum likelihood estimator can be found to be \hat{p} = \frac{1}{\bar{x}}, where \bar{x} is the sample mean.{{Cite web |last=Siegrist |first=Kyle |date=2020-05-05 |title=7.3: Maximum Likelihood |url=https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/07%3A_Point_Estimation/7.03%3A_Maximum_Likelihood |access-date=2024-06-20 |website=Statistics LibreTexts |language=en}} If the domain is \mathbb{N}_0, then the estimator shifts to \hat{p} = \frac{1}{\bar{x}+1}. As previously discussed in § Method of moments, these estimators are biased.

Regardless of the domain, the bias is equal to

:

b \equiv \operatorname{E}\bigg[\;(\hat p_\mathrm{mle} - p)\;\bigg]

= \frac{p\,(1-p)}{n}

which yields the bias-corrected maximum likelihood estimator,{{Cn|date=July 2024}}

:

\hat{p\,}^*_\text{mle} = \hat{p\,}_\text{mle} - \hat{b\,}

= 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.{{Rp|page=167}} 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 \mathrm{Beta}(\alpha,\beta) prior is selected, then the posterior, after observing samples k_1, \dotsc, k_n \in \mathbb{N}, is{{Cite CiteSeerX |citeseerx=10.1.1.157.5540 |first=Daniel |last=Fink |title=A Compendium of Conjugate Priors}}p \sim \mathrm{Beta}\left(\alpha+n,\ \beta+\sum_{i=1}^n (k_i-1)\right). \!Alternatively, if the samples are in \mathbb{N}_0, the posterior distribution is{{Cite web|url=http://halweb.uc3m.es/esp/Personal/personas/mwiper/docencia/English/PhD_Bayesian_Statistics/ch3_2009.pdf |archive-url=https://web.archive.org/web/20100408092905/http://halweb.uc3m.es/esp/Personal/personas/mwiper/docencia/English/PhD_Bayesian_Statistics/ch3_2009.pdf |archive-date=2010-04-08 |url-status=live|title=3. Conjugate families of distributions}}p \sim \mathrm{Beta}\left(\alpha+n,\beta+\sum_{i=1}^n k_i\right).Since the expected value of a \mathrm{Beta}(\alpha,\beta) distribution is \frac{\alpha}{\alpha+\beta},{{Rp|page=145}} as \alpha and \beta approach zero, the posterior mean approaches its maximum likelihood estimate.

Random variate generation

{{Further|Non-uniform random variate generation}}

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.{{Cite book |last=Devroye |first=Luc |url=http://link.springer.com/10.1007/978-1-4613-8643-8 |title=Non-Uniform Random Variate Generation |publisher=Springer New York |year=1986 |isbn=978-1-4613-8645-2 |location=New York, NY |language=en |doi=10.1007/978-1-4613-8643-8}}{{Rp|page=498}}

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 \lceil -E/\log(1-p) \rceil. In turn, E can be generated from a standard uniform random variable U altering the formula into \lceil \log(U) / \log(1-p)\rceil.{{Rp|pages=499–500}}{{Cite book |last=Knuth |first=Donald Ervin |title=The Art of Computer Programming |publisher=Addison-Wesley |year=1997 |isbn=978-0-201-89683-1 |edition=3rd |volume=2 |location=Reading, Mass |pages=136 |language=en}}

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.{{Cite book |last=Daskin |first=Mark S. |url=https://link.springer.com/10.1007/978-3-031-02493-1 |title=Bite-Sized Operations Management |publisher=Springer International Publishing |year=2021 |isbn=978-3-031-01365-2 |series=Synthesis Lectures on Operations Research and Applications |location=Cham |page=127 |language=en |doi=10.1007/978-3-031-02493-1}} In stochastic processes, the Yule Furry process is geometrically distributed.{{Cite book |last1=Madhira |first1=Sivaprasad |url=https://link.springer.com/10.1007/978-981-99-5601-2 |title=Introduction to Stochastic Processes Using R |last2=Deshmukh |first2=Shailaja |publisher=Springer Nature Singapore |year=2023 |isbn=978-981-99-5600-5 |location=Singapore |page=449 |language=en |doi=10.1007/978-981-99-5601-2}} The distribution also arises when modeling the lifetime of a device in discrete contexts.{{Citation |last1=Gupta |first1=Rakesh |title=Some Discrete Parametric Markov–Chain System Models to Analyze Reliability |date=2023 |work=Advances in Reliability, Failure and Risk Analysis |pages=305–306 |editor-last=Garg |editor-first=Harish |url=https://link.springer.com/10.1007/978-981-19-9909-3_14 |access-date=2024-07-13 |place=Singapore |publisher=Springer Nature Singapore |language=en |doi=10.1007/978-981-19-9909-3_14 |isbn=978-981-19-9908-6 |last2=Gupta |first2=Shubham |last3=Ali |first3=Irfan}} It has also been used to fit data including modeling patients spreading COVID-19.{{Cite journal |last=Polymenis |first=Athanase |date=2021-10-01 |title=An application of the geometric distribution for assessing the risk of infection with SARS-CoV-2 by location |url=https://www.nepjol.info/index.php/AJMS/article/view/38783 |journal=Asian Journal of Medical Sciences |volume=12 |issue=10 |pages=8–11 |doi=10.3126/ajms.v12i10.38783 |issn=2091-0576|doi-access=free }}

See also

References