# 泊松分佈

（重定向自帕松分布

參數 横轴是索引k，发生次数。该函数只定义在k为整数的时候。连接线是只为了指导视觉。概率质量函數 横轴是索引k，发生次数。CDF在整数k处不连续，且在其他任何地方都是水平的，因为服从泊松分布的变量只针对整数值。累積分佈函數 λ > 0（实数） k ∈ { 0, 1, 2, 3, ... } ${\displaystyle {\frac {\lambda ^{k}}{k!}}e^{-\lambda }}$ ${\displaystyle {\frac {\Gamma (\lfloor k+1\rfloor ,\lambda )}{\lfloor k\rfloor !}}}$，或${\displaystyle e^{-\lambda }\sum _{i=0}^{\lfloor k\rfloor }{\frac {\lambda ^{i}}{i!}}\ }$，或${\displaystyle Q(\lfloor k+1\rfloor ,\lambda )}$ (对于${\displaystyle k\geq 0}$，其中${\displaystyle \Gamma (x,y)}$是不完全Γ函数，${\displaystyle \lfloor k\rfloor }$是高斯符号，Q是规则化Γ函数) ${\displaystyle \lambda }$ ${\displaystyle \approx \lfloor \lambda +1/3-0.02/\lambda \rfloor }$ ${\displaystyle \lceil \lambda \rceil -1,\lfloor \lambda \rfloor }$ ${\displaystyle \lambda }$ ${\displaystyle \lambda ^{-1/2}}$ ${\displaystyle \lambda ^{-1}}$ ${\displaystyle \lambda [1-\log(\lambda )]+e^{-\lambda }\sum _{k=0}^{\infty }{\frac {\lambda ^{k}\log(k!)}{k!}}}$ (for large ${\displaystyle \lambda }$) ${\displaystyle {\frac {1}{2}}\log(2\pi e\lambda )-{\frac {1}{12\lambda }}-{\frac {1}{24\lambda ^{2}}}-}$${\displaystyle \qquad {\frac {19}{360\lambda ^{3}}}+O\left({\frac {1}{\lambda ^{4}}}\right)}$ ${\displaystyle \exp(\lambda (e^{t}-1))}$ ${\displaystyle \exp(\lambda (e^{it}-1))}$

${\displaystyle P(X=k)={\frac {e^{-\lambda }\lambda ^{k}}{k!}}}$

## 记号

${\displaystyle X}$ 服从参数为${\displaystyle \lambda }$ 的泊松分布，记为${\displaystyle X\sim \pi (\lambda )}$ ，或记为${\displaystyle X\sim Pois(\lambda )}$ .

## 性质

1、服从泊松分布的随机变量，其数学期望方差相等，同为参数${\displaystyle \lambda }$  : ${\displaystyle E(X)=V(X)=\lambda }$

2、兩個獨立且服从泊松分布的随机变量，其和仍然服从泊松分布。更精確地說，若 ${\displaystyle X\sim Poisson(\lambda _{1})}$ ${\displaystyle Y\sim Poisson(\lambda _{2})}$ ，則${\displaystyle X+Y\sim Poisson(\lambda _{1}+\lambda _{2})}$

3、其動差生成函數为：

${\displaystyle M_{X}(t)=E[e^{tX}]=\sum _{x=0}^{\infty }e^{tx}{\frac {e^{-\lambda }\lambda ^{x}}{x!}}=e^{-\lambda }\sum _{x=0}^{\infty }{\frac {({e^{t}}\lambda )^{x}}{x!}}=e^{{\lambda }(e^{t}-1)}}$

## 推導

{\displaystyle {\begin{aligned}\mathrm {E} (X)&=\textstyle \sum _{i=0}^{\infty }\displaystyle iP(X=i)\\&=\textstyle \sum _{i=1}^{\infty }\displaystyle i{e^{-\lambda }\lambda ^{i} \over i!}\\&=\lambda e^{-\lambda }\textstyle \sum _{i=1}^{\infty }\displaystyle {\lambda ^{i-1} \over (i-1)!}\\&=\lambda e^{-\lambda }\textstyle \sum _{i=0}^{\infty }\displaystyle {\lambda ^{i} \over i!}\\&=\lambda e^{-\lambda }e^{\lambda }\\&=\lambda \end{aligned}}}

{\displaystyle {\begin{aligned}\mathrm {E} (X^{2})&=\textstyle \sum _{i=0}^{\infty }\displaystyle i^{2}P(X=i)\\&=\textstyle \sum _{i=1}^{\infty }\displaystyle i^{2}{e^{-\lambda }\lambda ^{i} \over i!}\\&=\lambda e^{-\lambda }\textstyle \sum _{i=1}^{\infty }\displaystyle {i\lambda ^{i-1} \over (i-1)!}\\&=\lambda e^{-\lambda }\textstyle \sum _{i=1}^{\infty }\displaystyle {1 \over (i-1)!}{d \over d\lambda }(\lambda ^{i})\\&=\lambda e^{-\lambda }{d \over d\lambda }[\textstyle \sum _{i=1}^{\infty }\displaystyle {\lambda ^{i} \over (i-1)!}]\\&=\lambda e^{-\lambda }{d \over d\lambda }[\lambda \textstyle \sum _{i=1}^{\infty }\displaystyle {\lambda ^{i-1} \over (i-1)!}]\\&=\lambda e^{-\lambda }{d \over d\lambda }(\lambda e^{\lambda })=\lambda e^{-\lambda }(e^{\lambda }+\lambda e^{\lambda })=\lambda +\lambda ^{2}\end{aligned}}}

## 泊松分布的来源（泊松小数定律）

${\displaystyle \lim _{n\to \infty }\left(1-{\lambda \over n}\right)^{n}=e^{-\lambda },}$

${\displaystyle P(X=k)={n \choose k}p^{k}(1-p)^{n-k}}$

{\displaystyle {\begin{aligned}\lim _{n\to \infty }P(X=k)&=\lim _{n\to \infty }{n \choose k}p^{k}(1-p)^{n-k}\\&=\lim _{n\to \infty }{n! \over (n-k)!k!}\left({\lambda \over n}\right)^{k}\left(1-{\lambda \over n}\right)^{n-k}\\&=\lim _{n\to \infty }\underbrace {\left[{\frac {n!}{n^{k}\left(n-k\right)!}}\right]} _{F}\left({\frac {\lambda ^{k}}{k!}}\right)\underbrace {\left(1-{\frac {\lambda }{n}}\right)^{n}} _{\to \exp \left(-\lambda \right)}\underbrace {\left(1-{\frac {\lambda }{n}}\right)^{-k}} _{\to 1}\\&=\lim _{n\to \infty }\underbrace {\left[\left(1-{\frac {1}{n}}\right)\left(1-{\frac {2}{n}}\right)\ldots \left(1-{\frac {k-1}{n}}\right)\right]} _{\to 1}\left({\frac {\lambda ^{k}}{k!}}\right)\underbrace {\left(1-{\frac {\lambda }{n}}\right)^{n}} _{\to \exp \left(-\lambda \right)}\underbrace {\left(1-{\frac {\lambda }{n}}\right)^{-k}} _{\to 1}\\&=\left({\frac {\lambda ^{k}}{k!}}\right)\exp \left(-\lambda \right)\end{aligned}}}

## 極大似然估計（MLE）

{\displaystyle {\begin{aligned}L(\lambda )&=\ln \prod _{i=1}^{n}f(k_{i}\mid \lambda )\\&=\sum _{i=1}^{n}\ln \!\left({\frac {e^{-\lambda }\lambda ^{k_{i}}}{k_{i}!}}\right)\\&=-n\lambda +\left(\sum _{i=1}^{n}k_{i}\right)\ln(\lambda )-\sum _{i=1}^{n}\ln(k_{i}!).\end{aligned}}}
${\displaystyle {\frac {\mathrm {d} }{\mathrm {d} \lambda }}L(\lambda )=0\iff -n+\left(\sum _{i=1}^{n}k_{i}\right){\frac {1}{\lambda }}=0.\!}$

${\displaystyle {\widehat {\lambda }}_{\mathrm {MLE} }={\frac {1}{n}}\sum _{i=1}^{n}k_{i}.\!}$

${\displaystyle {\frac {\partial ^{2}L}{\partial \lambda ^{2}}}=\sum _{i=1}^{n}-\lambda ^{-2}k_{i}}$

## 生成泊松分布的随机变量

algorithm poisson random number (Knuth):
init:
Let L ← e−λ, k ← 0 and p ← 1.
do:
k ← k + 1.
Generate uniform random number u in [0,1] and let p ← p×u.
while p > L.
return k − 1.


algorithm Poisson generator based upon the inversion by sequential search:[1]
init:
Let x ← 0, p ← e−λ, s ← p.
Generate uniform random number u in [0,1].
do:
x ← x + 1.
p ← p * λ / x.
s ← s + p.
while u > s.
return x.


## 注释

1. ^ Luc Devroye, Non-Uniform Random Variate Generation（Springer-Verlag, New York, 1986）, chapter 10, page 505 http://luc.devroye.org/rnbookindex.html 页面存档备份，存于互联网档案馆

## 参考文献

• Guerriero V. Power Law Distribution: Method of Multi-scale Inferential Statistics. Journal of Modern Mathematics Frontier (JMMF). 2012, 1: 21–28 [2017-10-30]. （原始内容存档于2018-02-21）.
• Joachim H. Ahrens, Ulrich Dieter. Computer Methods for Sampling from Gamma, Beta, Poisson and Binomial Distributions. Computing. 1974, 12 (3): 223–246. doi:10.1007/BF02293108.
• Joachim H. Ahrens, Ulrich Dieter. Computer Generation of Poisson Deviates. ACM Transactions on Mathematical Software. 1982, 8 (2): 163–179. doi:10.1145/355993.355997.
• Ronald J. Evans, J. Boersma, N. M. Blachman, A. A. Jagers. The Entropy of a Poisson Distribution: Problem 87-6. SIAM Review. 1988, 30 (2): 314–317. doi:10.1137/1030059.
• Donald E. Knuth. Seminumerical Algorithms. The Art of Computer Programming, Volume 2. Addison Wesley. 1969.