Lably
Skip to content

Poisson binomial distribution

Probability distribution

  • 6 min read
  • 4 chapters

Related on Lably

Through Statistics, Probability distribution and Independence (probability theory)

In other words, it is the probability distribution of the number of successes in a collection of n independent yes/no experiments with success probabilities p1,p2,…,pn. The ordinary binomial distribution is a special case of the Poisson binomial distribution, when all success probabilities are the same, that is p1=p2=⋯=pn.

Definitions

Probability mass function

The probability of having k successful trials out of a total of n can be written as the sum

Pr(K=k)=∑A∈Fk∏i∈Api∏j∈Ac(1−pj)

where Fk is the set of all subsets of k integers that can be selected from {1,2,3,...,n}. For example, if n = 3, then F2={{1,2},{1,3},{2,3}}. Ac is the complement of A, i.e. Ac={1,2,3,…,n}∖A.

Fk will contain n!/((n−k)!k!) elements, the sum over which is infeasible to compute in practice unless the number of trials n is small (e.g. if n = 30, F15 contains over 1020 elements). However, there are other, more efficient ways to calculate Pr(K=k).

As long as none of the success probabilities are equal to one, one can calculate the probability of k successes using the recursive formula

Pr(K=k)={∏i=1n(1−pi)k=01k∑i=1k(−1)i−1Pr(K=k−i)T(i)k>0

where

T(i)=∑j=1n(pj1−pj)i.

The recursive formula is not numerically stable, and should be avoided if n is greater than approximately 20.

An alternative is to use a divide-and-conquer algorithm: if we assume n=2b is a power of two, denoting by f(pi:j) the Poisson binomial of pi,…,pj and ∗ the convolution operator, we have f(p1:2b)=f(p1:2b−1)∗f(p2b−1+1:2b).

More generally, the probability mass function of a Poisson binomial can be expressed as the convolution of the vectors P1,…,Pn where Pi=[1−pi,pi]. This observation leads to the direct convolution (DC) algorithm for computing Pr(K=0) through Pr(K=n):

<small id="mwWg"><i id="mwWw">// PMF and nextPMF begin at index 0</i> <b id="mwXA">function</b> DC(<span class="mwe-math-element mwe-math-element-inline" typeof="mw:Extension/math" about="#mwt50" data-mw='{"name":"math","attrs":{},"body":{"extsrc":"p_1, \\dots, p_n"}}' id="mwXQ"><span class="mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" class="mathjax_ignore" alttext="{\displaystyle p_{1},\dots ,p_{n}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>p</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>,</mo> <mo>…<!-- … --></mo> <mo>,</mo> <msub> <mi>p</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>n</mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle p_{1},\dots ,p_{n}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7a90efd8373125c90affd49557696138859c165a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; margin-left: -0.089ex; width:9.879ex; height:2.009ex;" alt="{\displaystyle p_{1},\dots ,p_{n}}"/></span>) <b id="mwXg">is</b> declare new PMF array of size 1 PMF[0] = [1] <b id="mwXw">for</b> i = 1 to <span class="mwe-math-element mwe-math-element-inline" typeof="mw:Extension/math" about="#mwt51" data-mw='{"name":"math","attrs":{},"body":{"extsrc":"n"}}' id="mwYA"><span class="mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" class="mathjax_ignore" alttext="{\displaystyle n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"/></span> <b id="mwYQ">do</b> declare new nextPMF array of size i + 1 nextPMF[0] = (1 - <span class="mwe-math-element mwe-math-element-inline" typeof="mw:Extension/math" about="#mwt52" data-mw='{"name":"math","attrs":{},"body":{"extsrc":"p_i"}}' id="mwYg"><span class="mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" class="mathjax_ignore" alttext="{\displaystyle p_{i}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>p</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle p_{i}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5bab39399bf5424f25d957cdc57c84a0622626d2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; margin-left: -0.089ex; width:2.059ex; height:2.009ex;" alt="{\displaystyle p_{i}}"/></span>) * PMF[0] nextPMF[i] = <span class="mwe-math-element mwe-math-element-inline" typeof="mw:Extension/math" about="#mwt53" data-mw='{"name":"math","attrs":{},"body":{"extsrc":"p_i"}}' id="mwYw"><span class="mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" class="mathjax_ignore" alttext="{\displaystyle p_{i}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>p</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle p_{i}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5bab39399bf5424f25d957cdc57c84a0622626d2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; margin-left: -0.089ex; width:2.059ex; height:2.009ex;" alt="{\displaystyle p_{i}}"/></span> * PMF[i - 1] <b id="mwZA">for</b> k = 1 <b id="mwZQ">to</b> i - 1 <b id="mwZg">do</b> nextPMF[k] = <span class="mwe-math-element mwe-math-element-inline" typeof="mw:Extension/math" about="#mwt54" data-mw='{"name":"math","attrs":{},"body":{"extsrc":"p_i"}}' id="mwZw"><span class="mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" class="mathjax_ignore" alttext="{\displaystyle p_{i}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>p</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle p_{i}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5bab39399bf5424f25d957cdc57c84a0622626d2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; margin-left: -0.089ex; width:2.059ex; height:2.009ex;" alt="{\displaystyle p_{i}}"/></span> * PMF[k - 1] + (1 - <span class="mwe-math-element mwe-math-element-inline" typeof="mw:Extension/math" about="#mwt55" data-mw='{"name":"math","attrs":{},"body":{"extsrc":"p_i"}}' id="mwaA"><span class="mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" class="mathjax_ignore" alttext="{\displaystyle p_{i}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>p</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle p_{i}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5bab39399bf5424f25d957cdc57c84a0622626d2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; margin-left: -0.089ex; width:2.059ex; height:2.009ex;" alt="{\displaystyle p_{i}}"/></span>) * PMF[k] <b id="mwaQ">repeat</b> PMF = nextPMF <b id="mwag">repeat</b> <b id="mwaw">return</b> PMF <b id="mwbA">end function</b></small>

Pr(K=k)will be found in PMF[k]. DC is numerically stable, exact, and, when implemented as a software routine, exceptionally fast for n≤2000. It can also be quite fast for larger n, depending on the distribution of the pi.

Another possibility is using the discrete Fourier transform.

Pr(K=k)=1n+1∑ℓ=0nC−lk∏m=1n(1+(Cℓ−1)pm)

where C=exp⁡(2iπn+1) and i=−1.

Still other methods are described in "Statistical Applications of the Poisson-Binomial and conditional Bernoulli distributions" by Chen and Liu and in "A simple and fast method for computing the Poisson binomial distribution function" by Biscarri et al.

Cumulative distribution function

The cumulative distribution function (CDF) can be expressed as:

Pr(K≤k)=∑ℓ=0k∑A∈Fℓ∏i∈Api∏j∈Ac(1−pj),

where Fℓ is the set of all subsets of size ℓ that can be selected from {1,2,3,…,n}.

It can be computed by invoking the DC function above, and then adding elements 0 through k of the returned PMF array.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Statistics