2.3 混合分布
2.3.1 高斯与伽马混合
X
∼
N
(
x
∣
μ
,
σ
2
τ
)
,
r
∼
G
a
(
r
∣
τ
2
,
τ
2
)
X\sim\mathcal{N}\left( x|\mu,\frac{\sigma^2}{\tau}\right),r\sim Ga\left( r|\frac{\tau}{2},\frac{\tau}{2}\right)
X∼N(x∣μ,τσ2),r∼Ga(r∣2τ,2τ)
p
(
x
∣
μ
,
σ
2
r
)
=
r
1
2
2
π
σ
e
x
p
[
−
1
2
r
(
x
−
μ
)
2
σ
2
]
,
p
(
r
∣
τ
2
,
τ
2
)
=
(
τ
2
)
τ
2
Γ
(
τ
2
)
r
τ
2
−
1
e
x
p
(
−
τ
2
r
)
p\left(x|\mu,\frac{\sigma^2}{r}\right)=\frac{r^{\frac{1}{2}}}{\sqrt{2\pi}\sigma}exp\left[-\frac{1}{2}\frac{r\left(x-\mu\right)^2}{\sigma^2}\right],p\left(r|\frac{\tau}{2},\frac{\tau}{2}\right)=\frac{\left(\frac{\tau}{2}\right)^{\frac{\tau}{2}}}{\Gamma\left(\frac{\tau}{2}\right)}r^{\frac{\tau}{2}-1} exp\left(-\frac{\tau}{2}r\right)
p(x∣μ,rσ2)=2πσr21exp[−21σ2r(x−μ)2],p(r∣2τ,2τ)=Γ(2τ)(2τ)2τr2τ−1exp(−2τr)
∫
0
+
∞
p
(
x
∣
μ
,
σ
2
r
)
p
(
r
∣
τ
2
,
τ
2
)
d
r
=
∫
0
+
∞
(
τ
2
)
τ
2
r
τ
−
1
2
2
π
Γ
(
τ
2
)
σ
e
x
p
{
−
r
2
[
(
x
−
μ
)
2
σ
2
+
τ
]
}
d
r
Let
B
=
(
τ
2
)
τ
2
2
π
Γ
(
τ
2
)
σ
,
A
=
(
x
−
μ
)
2
σ
2
+
τ
,
u
=
A
2
r
⇒
d
r
=
2
A
d
r
=
B
(
2
A
)
τ
+
1
2
∫
0
+
∞
u
τ
−
1
2
e
x
p
(
−
u
)
d
u
=
Γ
(
τ
+
1
2
)
Γ
(
τ
2
)
τ
π
σ
[
1
+
(
x
−
μ
)
2
τ
σ
2
]
−
(
τ
+
1
2
)
\begin{align*}&\int_0^{+\infty}p\left(x|\mu,\frac{\sigma^2}{r}\right)p\left(r|\frac{\tau}{2},\frac{\tau}{2}\right)dr\\=&\int_0^{+\infty} \frac{\left(\frac{\tau}{2}\right)^{\frac{\tau}{2}}r^\frac{\tau-1}{2}}{\sqrt{2\pi}\Gamma\left(\frac{\tau}{2}\right)\sigma}exp\left\{-\frac{r}{2}\left[ \frac{\left(x-\mu\right)^2}{\sigma^2} +\tau\right]\right\}dr\\&\text{Let} B=\frac{\left(\frac{\tau}{2}\right)^{\frac{\tau}{2}}}{\sqrt{2\pi}\Gamma\left(\frac{\tau}{2}\right)\sigma},A=\frac{\left(x-\mu\right)^2}{\sigma^2}+\tau,u=\frac{A}{2}r\Rightarrow dr=\frac{2}{A}dr\\=&B\left(\frac{2}{A}\right)^{\frac{\tau+1}{2}}\int_0^{+\infty} u^\frac{\tau-1}{2}exp(-u)du\\=&\frac{\Gamma\left(\frac{\tau+1}{2}\right)}{\Gamma\left(\frac{\tau}{2}\right)\sqrt{\tau \pi}\sigma}\left[ 1+\frac{\left(x-\mu\right)^2}{\tau \sigma^2}\right]^{-\left(\frac{\tau+1}{2}\right)}\end{align*}
===∫0+∞p(x∣μ,rσ2)p(r∣2τ,2τ)dr∫0+∞2πΓ(2τ)σ(2τ)2τr2τ−1exp{−2r[σ2(x−μ)2+τ]}drLetB=2πΓ(2τ)σ(2τ)2τ,A=σ2(x−μ)2+τ,u=2Ar⇒dr=A2drB(A2)2τ+1∫0+∞u2τ−1exp(−u)duΓ(2τ)τπσΓ(2τ+1)[1+τσ2(x−μ)2]−(2τ+1)
显然服从
T
T
T分布,即正态分布与伽马分布的混合分布可得
T
T
T分布,可将
G
a
(
r
∣
τ
2
,
τ
2
)
Ga\left(r|\frac{\tau}{2},\frac{\tau}{2}\right)
Ga(r∣2τ,2τ)视为
w
⃗
\vec{w}
w(权重矢量)。
2.3.2 高斯与指数混合
X
∼
N
(
x
∣
μ
,
r
)
,
r
∼
E
x
p
(
r
∣
2
σ
2
)
X\sim\mathcal{N}\left(x|\mu,r\right),r\sim Exp\left(r|2\sigma^2\right)
X∼N(x∣μ,r),r∼Exp(r∣2σ2)
p
(
x
∣
μ
,
r
)
=
r
1
2
2
π
e
x
p
[
−
1
2
(
x
−
μ
)
2
r
]
,
p
(
r
∣
s
σ
2
)
=
1
2
σ
2
e
x
p
(
−
r
2
σ
2
)
p(x|\mu,r)=\frac{r^{\frac{1}{2}}}{\sqrt{2\pi}}exp\left[-\frac{1}{2} \frac{\left(x-\mu\right)^2}{r}\right],p\left(r|s\sigma^2\right)=\frac{1}{2\sigma^2}exp\left(-\frac{r}{2\sigma^2}\right)
p(x∣μ,r)=2πr21exp[−21r(x−μ)2],p(r∣sσ2)=2σ21exp(−2σ2r)
∫
0
+
∞
p
(
x
∣
μ
,
r
)
p
(
r
∣
2
σ
2
)
d
r
=
∫
0
+
∞
r
1
2
2
2
π
σ
2
e
x
p
{
−
1
2
[
(
x
−
μ
)
2
r
+
r
σ
2
]
}
d
r
\int_0^{+\infty}p(x|\mu,r)p\left(r|2\sigma^2\right)dr=\int_0^{+\infty}\frac{r^{\frac{1}{2}}}{2\sqrt{2\pi}\sigma^2}exp\left\{-\frac{1}{2}\left[\frac{\left(x-\mu\right)^2}{r}+\frac{r}{\sigma^2}\right]\right\}dr
∫0+∞p(x∣μ,r)p(r∣2σ2)dr=∫0+∞22πσ2r21exp{−21[r(x−μ)2+σ2r]}dr
显然积分号内分布函数符合广义逆高斯分布,令
α
=
1
/
σ
2
\alpha=1/\sigma^2
α=1/σ2,
β
=
(
x
−
μ
)
2
\beta=\left(x-\mu\right)^2
β=(x−μ)2,则
{
α
β
=
1
σ
2
(
x
−
μ
)
2
α
β
=
(
x
−
μ
)
2
σ
2
,
p
=
1
2
⇒
{
(
α
β
)
p
2
=
1
σ
(
x
−
μ
)
2
K
p
(
α
β
)
=
2
π
σ
x
−
μ
e
x
p
(
−
∣
x
−
μ
∣
σ
)
⇒
(
α
β
)
p
2
2
K
p
(
α
β
)
=
1
2
π
σ
e
x
p
(
−
∣
x
−
μ
∣
σ
)
≜
A
∫
0
+
∞
p
(
x
∣
μ
,
r
)
p
(
r
∣
2
σ
2
)
d
r
=
1
2
σ
e
x
p
(
−
∣
x
−
μ
∣
σ
)
\begin{align*}&\begin{cases}\frac{\alpha}{\beta}=\frac{1}{\sigma^2\left(x-\mu\right)^2}\\\alpha\beta=\frac{\left(x-\mu\right)^2}{\sigma^2}\end{cases},p=\frac{1}{2}\Rightarrow\begin{cases}\left(\frac{\alpha}{\beta}\right)^{\frac{p}{2}}=\frac{1}{\sqrt{\sigma(x-\mu)}}\\2K_p\left(\sqrt{\alpha \beta}\right)=\sqrt{\frac{2\pi \sigma}{x-\mu}}exp\left(-\frac{|x-\mu|}{\sigma}\right)\end{cases}\\\Rightarrow&\frac{\left(\frac{\alpha}{\beta}\right)^{\frac{p}{2}}}{2K_p\left(\sqrt{\alpha\beta}\right)}=\frac{1}{\sqrt{2\pi}\sigma}exp\left(-\frac{|x-\mu|}{\sigma}\right)\triangleq A\\&\int_0^{+\infty}p(x|\mu,r)p\left(r|2\sigma^2\right)dr=\frac{1}{2\sigma}exp\left(-\frac{|x-\mu|}{\sigma}\right)\end{align*}
⇒{βα=σ2(x−μ)21αβ=σ2(x−μ)2,p=21⇒⎩
⎨
⎧(βα)2p=σ(x−μ)12Kp(αβ)=x−μ2πσexp(−σ∣x−μ∣)2Kp(αβ)(βα)2p=2πσ1exp(−σ∣x−μ∣)≜A∫0+∞p(x∣μ,r)p(r∣2σ2)dr=2σ1exp(−σ∣x−μ∣)
可见高斯分布与指数分布混合服从拉普拉斯分布。
2.3.3 泊松与伽马分布
X
∼
P
o
i
s
s
o
n
(
λ
)
,
λ
∼
G
a
m
m
a
(
r
,
1
−
p
p
)
,
0
<
p
<
1
,
r
>
0
P
(
X
=
k
)
=
λ
k
k
!
e
x
p
(
λ
)
=
λ
k
Γ
(
k
+
1
)
e
x
p
(
λ
)
p
(
λ
∣
r
,
1
−
p
p
)
=
(
1
−
p
)
r
Γ
(
r
)
p
r
λ
r
−
1
e
x
p
(
p
−
1
p
λ
)
∫
0
+
∞
P
(
X
=
k
)
P
(
λ
∣
r
,
1
−
p
p
)
d
λ
=
(
1
−
p
)
r
Γ
(
k
+
1
)
Γ
(
r
)
p
r
∫
0
+
∞
λ
k
+
r
−
1
e
x
p
(
−
λ
p
)
d
λ
=
Γ
(
k
+
r
)
Γ
(
k
)
Γ
(
r
)
p
k
(
1
−
p
)
r
∼
N
B
(
k
,
p
)
\begin{align*} &X\sim Poisson(\lambda),\lambda \sim Gamma\left(r,\frac{1-p}{p}\right),0<p<1,r>0 \\&P(X=k)=\frac{\lambda^k}{k!}exp(\lambda)=\frac{\lambda^k}{\Gamma(k+1)}exp(\lambda)\\&p\left(\lambda|r,\frac{1-p}{p}\right)=\frac{(1-p)^r}{\Gamma(r)p^r}\lambda^{r-1}exp\left(\frac{p-1}{p}\lambda\right)\\&\int_0^{+\infty}P(X=k)P\left(\lambda|r,\frac{1-p}{p}\right)d\lambda\\=&\frac{(1-p)^r}{\Gamma(k+1)\Gamma(r)p^r}\int_0^{+\infty}\lambda^{k+r-1} exp\left(-\frac{\lambda}{p}\right)d\lambda\\=&\frac{\Gamma(k+r)}{\Gamma(k)\Gamma(r)}p^k(1-p)^r\\\sim&NB(k,p)\end{align*}
==∼X∼Poisson(λ),λ∼Gamma(r,p1−p),0<p<1,r>0P(X=k)=k!λkexp(λ)=Γ(k+1)λkexp(λ)p(λ∣r,p1−p)=Γ(r)pr(1−p)rλr−1exp(pp−1λ)∫0+∞P(X=k)P(λ∣r,p1−p)dλΓ(k+1)Γ(r)pr(1−p)r∫0+∞λk+r−1exp(−pλ)dλΓ(k)Γ(r)Γ(k+r)pk(1−p)rNB(k,p)
可见,泊松分布与伽马分布混合可得负二项分布。