原文地址1:https://www.face2ai.com/Math-Probability-5-4-The-Poisson-Distribution转载请标明出处
Abstract: 本文介绍Poisson分布相关知识
Keywords: Poisson Distribution
泊松分布
前面这几个分布包括今天说的泊松分布都是和二项分布,伯努利分布相互联系的,之间有各种各样的关系,我们的学习目的不是背诵所有这些分布的性质,而是在这些性质的推到过程。
很多实验比较关注次数,比如一段时间内到达商店的顾客的人数,电话交换机每分钟受到的通话请求,洪水或者其他自然人为灾害发生的次数。泊松分布被用来建模,一段事件这些事情发生的次数,并且泊松分布也是用来近似当 p p p 很小的时候的二项分布的一种方法。
泊松分布的定义和性质 Definition and Properties of the Poisson Distributions
先来看一个商店一段时间有多少顾客到来的例子,这个例子会贯穿正片博客,大家应该好好读一下。
商店老板相信,顾客们以每个小时4.5 人次的数量来到商店,他想找到一个X的分布,这个X表示在未来某个一个小时,到店的客人数,并且他认为这些到来的客人之间相互独立,于是他的做法是按照一个小时3600秒计算,平均每秒来 0.00125 个人,并且假设一秒钟不会同时出现两个人同时到店的可能,那么某时间点,到达的人数为0或者1,为1的可能性是0.00125,整个过程是一个二项分布,n=3600,p=0.00125。
这看起来很正确也很流畅
于是他要计算p.f.了:
f
(
x
∣
n
=
3600
,
p
=
0.00125
)
=
{
(
3600
x
)
p
x
(
1
−
p
)
3600
−
x
for
0
≤
x
≤
3600
0
otherwise
f(x|n=3600,p=0.00125)= \begin{cases} \begin{pmatrix} 3600\\x \end{pmatrix}p^x(1-p)^{3600-x}&\text{for }0\leq x\leq 3600\\ 0&\text{otherwise} \end{cases}
f(x∣n=3600,p=0.00125)=⎩⎨⎧(3600x)px(1−p)3600−x0for 0≤x≤3600otherwise
这个式子非常有意思,当参数
(
3600
x
)
\begin{pmatrix} 360 0\\x \end{pmatrix}
(3600x) 变大的时候, 参数
p
x
(
1
−
p
)
3600
−
x
p^x(1-p)^{3600-x}
px(1−p)3600−x 似乎以同等的速度变小,而整体却变化不大,于是我们对相邻的两个随机变量值做个比较(以下把
X
X
X 扩展到在0到
n
n
n 之间变化)
f
(
x
+
1
)
f
(
x
)
=
(
n
x
+
1
)
p
x
+
1
(
1
−
p
)
n
−
x
−
1
(
n
x
)
p
x
+
1
(
1
−
p
)
n
−
x
−
1
=
(
n
−
x
)
p
(
x
+
1
)
(
1
−
p
)
≈
n
p
x
+
1
\begin{aligned} \frac{f(x+1)}{f(x)}&= \frac {\begin{pmatrix}n\\x+1\end{pmatrix}p^{x+1}(1-p)^{n-x-1}} {\begin{pmatrix}n\\x\end{pmatrix}p^{x+1}(1-p)^{n-x-1}}\\ &=\frac{(n-x)p}{(x+1)(1-p)}\\ &\approx\frac{np}{x+1} \end{aligned}
f(x)f(x+1)=(nx)px+1(1−p)n−x−1(nx+1)px+1(1−p)n−x−1=(x+1)(1−p)(n−x)p≈x+1np
那么根据这个比值,如果我们设
λ
=
n
p
\lambda=np
λ=np 那么我们会有一个递归关系:
f
(
1
)
=
f
(
0
)
λ
f
(
2
)
=
f
(
1
)
λ
2
=
f
(
0
)
λ
2
2
f
(
3
)
=
f
(
2
)
λ
3
=
f
(
0
)
λ
3
6
⋮
f
(
n
)
=
f
(
n
−
1
)
λ
n
=
=
f
(
0
)
λ
n
n
!
f(1)=f(0)\lambda\\ f(2)=f(1)\frac{\lambda}{2}=f(0)\frac{\lambda^2}{2}\\ f(3)=f(2)\frac{\lambda}{3}=f(0)\frac{\lambda^3}{6}\\ \vdots\\ f(n)=f(n-1)\frac{\lambda}{n}==f(0)\frac{\lambda^n}{n!}\\
f(1)=f(0)λf(2)=f(1)2λ=f(0)2λ2f(3)=f(2)3λ=f(0)6λ3⋮f(n)=f(n−1)nλ==f(0)n!λn
因为
f
f
f 是一个近似来的 p.f. 那么我们需要让他满足我们的条件,比如,所有随机变量对应的概率求和是1.
∑
x
=
0
∞
f
(
x
)
=
1
\sum^{\infty}_{x=0}f(x)=1
x=0∑∞f(x)=1
因为整个关系式能调整的部分就只有
f
(
0
)
f(0)
f(0) 了,那么我们只好调整初始化条件来使得p.f.成立了,
∑
x
=
0
∞
f
(
0
)
λ
n
n
!
=
1
f
(
0
)
∑
x
=
0
∞
λ
n
n
!
=
1
for :
∑
x
=
0
∞
λ
n
n
!
=
e
λ
so :
f
(
0
)
=
e
−
λ
\sum^{\infty}_{x=0}f(0)\frac{\lambda^n}{n!}=1\\ f(0)\sum^{\infty}_{x=0}\frac{\lambda^n}{n!}=1\\ \text{for :}\sum^{\infty}_{x=0}\frac{\lambda^n}{n!}=e^{\lambda}\\ \text{so :}f(0)=e^{-\lambda}
x=0∑∞f(0)n!λn=1f(0)x=0∑∞n!λn=1for :x=0∑∞n!λn=eλso :f(0)=e−λ
所以我们只需要让
f
(
0
)
=
e
−
λ
f(0)=e^{-\lambda}
f(0)=e−λ 即可,关于求和等于
e
λ
e^{\lambda}
eλ 的计算可以参开微积分书籍。
那么我们就有了一个新的能够近似上面二项分布的新分布——Poisson Distribution:
f
(
x
∣
λ
)
=
{
e
−
λ
λ
x
x
!
for
x
=
1
,
2
,
3
,
…
0
otherwise
f(x|\lambda)= \begin{cases} \frac{e^{-\lambda}\lambda^x}{x!}&\text{for }x=1,2,3,\dots\\ 0&\text{otherwise} \end{cases}
f(x∣λ)={x!e−λλx0for x=1,2,3,…otherwise
这个分布就是我们今天的主角,也是概率论中非常重要的一个分布,可以用来描述一段时间内某事发生的次数的模型。
Definition Poisson Distribution.Let λ > 0 \lambda > 0 λ>0 .A random variable X has the Poisson Distribution with mean λ \lambda λ if the p.f. of X X X is as follow:
f ( x ∣ λ ) = { e − λ λ x x ! for x = 1 , 2 , 3 , … 0 otherwise f(x|\lambda)= \begin{cases} \frac{e^{-\lambda}\lambda^x}{x!}&\text{for }x=1,2,3,\dots\\ 0&\text{otherwise} \end{cases} f(x∣λ)={x!e−λλx0for x=1,2,3,…otherwise
还是传统的定义方法,告诉你,这个式子是泊松分布~
泊松分布的均值 Mean
Theorem Mean. The mean of Poisson Distribution with p.f. equal to upside is λ \lambda λ .
怎么样!神奇不神奇~均值是 λ \lambda λ
我们接下来就来证明这一点。
直接使用期望的定义
E ( X ) = ∑ x = 0 ∞ x f ( x ∣ λ ) E(X)=\sum^{\infty}_{x=0}xf(x|\lambda) E(X)=x=0∑∞xf(x∣λ)
当x=0 时,值为0,我们直接从1开始
E ( X ) = ∑ x = 0 ∞ x e − λ λ x x ! = ∑ x = 1 ∞ e − λ λ x ( x − 1 ) ! = λ ∑ x = 1 ∞ e − λ λ x − 1 ( x − 1 ) ! if we set y = x − 1 = λ ∑ y = 0 ∞ e − λ λ y y ! \begin{aligned} E(X)&=\sum^{\infty}_{x=0}x\frac{e^{-\lambda}\lambda^x}{x!}\\ &=\sum^{\infty}_{x=1}\frac{e^{-\lambda}\lambda^x}{(x-1)!}\\ &=\lambda\sum^{\infty}_{x=1}\frac{e^{-\lambda}\lambda^{x-1}}{(x-1)!}\\ \text{if we set } y=x-1\\ &=\lambda\sum^{\infty}_{y=0}\frac{e^{-\lambda}\lambda^{y}}{y!} \end{aligned} E(X)if we set y=x−1=x=0∑∞xx!e−λλx=x=1∑∞(x−1)!e−λλx=λx=1∑∞(x−1)!e−λλx−1=λy=0∑∞y!e−λλy
这样 ∑ y = 0 ∞ e − λ λ y y ! \sum^{\infty}_{y=0}\frac{e^{-\lambda}\lambda^{y}}{y!} ∑y=0∞y!e−λλy 变成了一个对p.f.为 f ( y ∣ λ ) f(y|\lambda) f(y∣λ) 的概率函数求和的计算,结果必然为1,那么我们就证明了泊松分布的期望是 —— λ \lambda λ
泊松分布的方差 Varaince
Theorem Variance.The variance of Poisson distribution with mean λ \lambda λ is also λ \lambda λ
意外不意外!惊喜不惊喜!依旧是 λ \lambda λ
证明:
我们将用到和上面证明期望一样的方法就是通过凑,来使得求和里面变成 p.f.的样子
E [ X ( X − 1 ) ] = ∑ x = 0 ∞ x ( x − 1 ) f ( x ∣ λ ) = ∑ x = 2 ∞ x ( x − 1 ) f ( x ∣ λ ) = ∑ x = 2 ∞ x ( x − 1 ) e − λ λ x x ! = λ 2 ∑ x = 2 ∞ e − λ λ x − 2 x − 2 ! We set y = x − 2 E [ X ( X − 1 ) ] = λ 2 ∑ y = 0 ∞ e − λ λ y y ! = λ 2 \begin{aligned} E[X(X-1)]&=\sum^{\infty}_{x=0}x(x-1)f(x|\lambda)\\ &=\sum^{\infty}_{x=2}x(x-1)f(x|\lambda)\\ &=\sum^{\infty}_{x=2}x(x-1)\frac{e^{-\lambda}\lambda^x}{x!}\\ &=\lambda^2\sum^{\infty}_{x=2}\frac{e^{-\lambda}\lambda^{x-2}}{x-2!}\\ \text{We set }y=x-2\\ E[X(X-1)]&=\lambda^2\sum^{\infty}_{y=0}\frac{e^{-\lambda}\lambda^y}{y!}\\ &=\lambda^2 \end{aligned} E[X(X−1)]We set y=x−2E[X(X−1)]=x=0∑∞x(x−1)f(x∣λ)=x=2∑∞x(x−1)f(x∣λ)=x=2∑∞x(x−1)x!e−λλx=λ2x=2∑∞x−2!e−λλx−2=λ2y=0∑∞y!e−λλy=λ2
然后我们祭出我们的大招
E
[
X
(
X
−
1
)
]
=
E
[
X
2
]
−
E
[
X
]
=
E
[
X
2
]
−
λ
=
λ
2
E[X(X-1)]=E[X^2]-E[X]=E[X^2]-\lambda=\lambda^2
E[X(X−1)]=E[X2]−E[X]=E[X2]−λ=λ2 所以
E
[
X
2
]
=
λ
2
+
λ
E[X^2]=\lambda^2+\lambda
E[X2]=λ2+λ 那么
V
a
r
(
X
)
=
E
[
X
2
]
−
E
2
[
x
]
=
λ
2
+
λ
−
λ
2
=
λ
Var(X)=E[X^2]-E^2[x]=\lambda^2+\lambda-\lambda^2=\lambda
Var(X)=E[X2]−E2[x]=λ2+λ−λ2=λ
至此证毕,构造了 E [ X 2 ] E[X^2] E[X2] 然后求出了 V a r ( X ) Var(X) Var(X)
泊松分布的距生成函数 m.g.f.
接着我们研究第三大工具,m.g.f.
Theorem Moment Generating Function.The m.g.f. of the Poisson distribution with mean λ \lambda λ is
ψ ( t ) = e λ ( e t − 1 ) \psi(t)=e^{\lambda(e^t-1)} ψ(t)=eλ(et−1)
for all real t t t
证明如下:
ψ ( t ) = E ( e t X ) = ∑ x = 0 ∞ e t x e − λ λ x x ! = e − λ ∑ x = 0 ∞ ( λ e t ) x x ! \psi(t)=E(e^{tX})=\sum^{\infty}_{x=0}\frac{e^{tx}e^{-\lambda}\lambda^x}{x!}=e^{-\lambda}\sum^{\infty}_{x=0}\frac{(\lambda e^t)^x}{x!} ψ(t)=E(etX)=x=0∑∞x!etxe−λλx=e−λx=0∑∞x!(λet)x
根据 e e e 级数性质
∑ x = 0 ∞ ( λ e t ) x x ! = e λ e t \sum^{\infty}_{x=0}\frac{(\lambda e^t)^x}{x!}=e^{\lambda e^t} x=0∑∞x!(λet)x=eλet
那么我们对于 − ∞ < t < ∞ -\infty < t< \infty −∞<t<∞ 有:
ψ ( t ) = e − λ e λ e t = e λ ( e t − 1 ) \psi(t)=e^{-\lambda}e^{\lambda e^t}=e^{\lambda(e^t-1)} ψ(t)=e−λeλet=eλ(et−1)
有了m.g.f就能得到期望,方差或者其他阶距。
泊松分布随机变量相加
Theorem If the random variable X 1 , … , X k X_1,\dots,X_k X1,…,Xk are independent and if X i X_i Xi has Poisson distribution with mean λ i ( i = 1 , … , k ) \lambda_i(i=1,\dots,k) λi(i=1,…,k) ,then the sum X 1 + ⋯ + X k X_1+\dots+X_k X1+⋯+Xk has the Poisson distribution with mean λ 1 + ⋯ + λ k \lambda_1+\dots+\lambda_k λ1+⋯+λk
拥有相同参数的二项分布可以进行加法运算,这一点我们前面就已经证明过了,今天要证明的是Poisson分布也能进行加法,而且不需要参数一致,用到的方法是用m.g.f进行分析:
证明:
首先令
ψ
i
(
t
)
\psi_i(t)
ψi(t) 来定义
X
i
X_i
Xi 的m.g.f. 并且
X
i
X_i
Xi 是均值为
λ
i
\lambda_i
λi 的Poisson分布。并且
X
1
,
…
,
X
n
X_1,\dots,X_n
X1,…,Xn 之间相互独立,那么对于
−
∞
<
t
<
∞
-\infty<t<\infty
−∞<t<∞ 我们有:
ψ
(
t
)
=
Π
i
=
1
k
ψ
i
(
t
)
=
Π
i
=
1
k
e
λ
i
(
e
t
−
1
)
=
e
(
λ
1
+
⋯
+
λ
k
)
(
e
t
−
1
)
\psi(t)=\Pi^k_{i=1}\psi_i(t)=\Pi^k_{i=1}e^{\lambda_i(e^t-1)}=e^{(\lambda_1+\dots+\lambda_k)(e^t-1)}
ψ(t)=Πi=1kψi(t)=Πi=1keλi(et−1)=e(λ1+⋯+λk)(et−1)
结合前面泊松分布的m.g.f.可见定理成立。
二项分布的泊松近似 The Poisson Approximation to Binomial Distributions
接下来我们研究一下泊松分布近似二项分布的详细内容。
Theorem Closeness of Binomial and Pisson Distribution.For each integer n and each 0 < p < 1 0 < p < 1 0<p<1 ,let f ( x ∣ n , p ) f(x|n,p) f(x∣n,p) denote the p.f. of the binomial distribtuion with parameters n n n and p p p .Let f ( x ∣ λ ) f(x|\lambda) f(x∣λ) denote the p.f. of the Poisson distribution with mean λ \lambda λ .Let { P n } n = 1 ∞ {\{P_n\}}^{\infty}_{n=1} {Pn}n=1∞ be a sequence of numbers between 0 and 1 such that l i m n → ∞ n p n = λ lim_{n\to \infty}np_n=\lambda limn→∞npn=λ . Then
l i m n → ∞ f ( x ∣ n , p n ) = f ( x ∣ λ ) lim_{n\to \infty}f(x|n,p_n)=f(x|\lambda) limn→∞f(x∣n,pn)=f(x∣λ)
for all x = 0 , 1 … x=0,1\dots x=0,1…
定理表明了二项分布和Poisson分布的近似关系,虽然我们在开篇的例子里面已经提到了用Poisson分布来近似
n
n
n 比较大,
p
p
p 比较小,
n
p
np
np 又不大的问题,但是我们还是需要从理论上分析下二项分布和Poisson分布到底有什么关系。
证明:
首先我们写出二项分布
f
(
x
∣
n
,
p
n
)
=
n
(
n
−
1
)
…
(
n
−
x
+
1
)
x
!
p
n
x
(
1
−
p
n
)
n
−
x
f(x|n,p_n)=\frac{n(n-1)\dots(n-x+1)}{x!}p_n^x(1-p_n)^{n-x}
f(x∣n,pn)=x!n(n−1)…(n−x+1)pnx(1−pn)n−x
提示,把组合运算展开写的。
然后我们令
λ
n
=
n
p
n
\lambda_n=np_n
λn=npn 那么
l
i
m
n
→
∞
λ
n
=
λ
lim_{n\to \infty}\lambda_n=\lambda
limn→∞λn=λ 这样我们就有
f
(
x
∣
n
,
p
n
)
=
λ
n
x
x
!
n
n
⋅
n
−
1
n
…
n
−
x
+
1
n
(
1
−
λ
n
n
)
n
(
1
−
λ
n
n
)
−
x
f(x|n,p_n)=\frac{\lambda_n^x}{x!}\frac{n}{n}\cdot\frac{n-1}{n}\dots \frac{n-x+1}{n}(1-\frac{\lambda_n}{n})^n(1-\frac{\lambda_n}{n})^{-x}
f(x∣n,pn)=x!λnxnn⋅nn−1…nn−x+1(1−nλn)n(1−nλn)−x
对于每个
x
≥
0
x\geq 0
x≥0 来说,我们有:
l
i
m
n
→
∞
n
n
⋅
n
−
1
n
…
n
−
x
+
1
n
(
1
−
λ
n
n
)
−
x
=
1
lim_{n\to \infty}\frac{n}{n}\cdot\frac{n-1}{n}\dots \frac{n-x+1}{n}(1-\frac{\lambda_n}{n})^{-x}=1
limn→∞nn⋅nn−1…nn−x+1(1−nλn)−x=1
这个是微积分要解决的问题,不知道的同学需要去参考下微积分的知识。上文中倒数第二个定理,我们没有证明,但是那个结论在这里还需要再次使用
l
i
m
n
→
∞
(
1
−
λ
n
n
)
n
=
e
−
λ
lim_{n\to \infty}(1-\frac{\lambda_n}{n})^{n}=e^{-\lambda}
limn→∞(1−nλn)n=e−λ
所以
l
i
m
n
→
∞
f
(
x
∣
n
,
p
n
)
=
e
−
λ
λ
x
x
!
=
f
(
x
∣
λ
)
lim_{n\to \infty}f(x|n,p_n)=\frac{e^{-\lambda}\lambda^x}{x!}=f(x|\lambda)
limn→∞f(x∣n,pn)=x!e−λλx=f(x∣λ)
证毕。
接下来这个定理是说超几何分布和Poisson分布之间的关系的,没有证明,但是可以参考下结论。
Theorem Closeness of Hypergeometric and Poisson Distribution.Let λ > 0 \lambda>0 λ>0 .Let Y Y Y have the Poisson distribution with mean λ \lambda λ .For each postive integer T T T ,let A T , B T A_T,B_T AT,BT ,and n T n_T nT be integers such that l i m T → ∞ n T A T / ( A T + B T ) = λ lim_{T\to \infty}n_TA_T/(A_T+B_T)=\lambda limT→∞nTAT/(AT+BT)=λ .Let X T X_T XT have the hypergeometric distribution with parameters A T , B T A_T,B_T AT,BT and n T n_T nT .Tor each fixed x = 0 , 1 , … x=0,1,\dots x=0,1,… ,
l i m T → ∞ P r ( Y = x ) P r ( X t = x ) = 1 lim_{T\to \infty}\frac{Pr(Y=x)}{Pr(X_t=x)}=1 limT→∞Pr(Xt=x)Pr(Y=x)=1
泊松过程 Poisson Processes
前面我们第一个例子说的如何估算在一个小时内到店的客户,那么如果是我想知道半个小时或者15分钟的顾客数量呢?难道是要用2.25个或者1.125个作为平均数的Poisson Distribution建模么?于是我们使用Poisson过程来对这种情况建模。
Definition Poisson Process.A Poisson process with rate λ \lambda λ per unit time is a process that satisfies the following two properties:
i: The number of arrivals in every fixed interval of time of length t t t has the Poisson distribution with mean λ t \lambda t λt
ii: The numbers of arrivals in every collection of disjoint time intervals are independent
泊松过程满足两点要求,首先固定时间段内平均时长
λ
t
\lambda t
λt,其次每个不同时段之间人数彼此独立。
所以上面我们说是否能用改了
λ
\lambda
λ 的泊松分布建模这个答案是肯定的就是通过改变
λ
\lambda
λ 值来重新建模的。
后面有一个关于泊松过程的选读内容,有兴趣的同学可以在书上找到
总结
本文介绍泊松分布,性质及用途,以及泊松过程
明天继续。。