期望最大(EM)算法推导

X是一个随机向量,我们希望找到[img]http://latex.codecogs.com/gif.latex?\theta[/img]
使得[img]http://latex.codecogs.com/gif.latex?P(X|\theta)[/img]取得最大值,这就是关于[img]http://latex.codecogs.com/gif.latex?\theta[/img]的最大似然估计。
为了方便估计[img]http://latex.codecogs.com/gif.latex?\theta[/img],我们一般引入log似然函数:
[img]http://latex.codecogs.com/gif.latex?L(\theta)=lnP(X|\theta)[/img]
EM算法是一个迭代的过程,假设第n次迭代当前[img]http://latex.codecogs.com/gif.latex?\theta[/img]的估计是[img]http://latex.codecogs.com/gif.latex?\theta_n[/img]。由于我们的目标是最大化[img]http://latex.codecogs.com/gif.latex?L(\theta)[/img],我们希望新一轮的更新[img]http://latex.codecogs.com/gif.latex?\theta[/img]使得
[img]http://latex.codecogs.com/gif.latex?L(\theta)>L(\theta_n)}[/img]
等价的,我们希望最大化他们的不同:
[img]http://latex.codecogs.com/gif.latex?L(\theta)-L(\theta_n)=lnP(X|\theta)-lnP(x|\theta_n)[/img]
现在我们考虑隐变量的问题,隐变量可能是没有观测到的或者缺失的变量,有时为了计算最大似然函数更容易解决也会引入隐变量,因为可以利用EM框架来方便计算。我们假设隐变量用Z来表示,那么
[img]http://latex.codecogs.com/gif.latex?P(X|\theta)=\sum_z{P(X|z,\theta)P(z|\theta)[/img]
我们重写一下[img]http://latex.codecogs.com/gif.latex?L(\theta)-L(\theta_n)[/img]得到:
[img]http://latex.codecogs.com/gif.latex?L(\theta)-L(\theta_n)=ln(\sum_z{P(X|z,\theta)P(z|\theta)})-lnP(X|\theta_n)[/img]
利用Jensen's不定式:
[img]http://latex.codecogs.com/gif.latex?ln\sum_{i=1}^n\lambda_ix_i\ge\sum_{i=1}^n\lambda_i{ln(x_i)}[/img]
其中常量[img]http://latex.codecogs.com/gif.latex?\lambda_i\ge0[/img]并且[img]http://latex.codecogs.com/gif.latex?\sum_{i=1}^n\lambda_i=1[/img]
[img]http://latex.codecogs.com/gif.latex?L(\theta)-L(\theta_n)=ln(\sum_z{P(X|z,\theta)P(z|\theta)})-lnP(X|\theta_n)[/img]
[img]http://latex.codecogs.com/gif.latex?=ln(\sum_z{P(X|z,\theta)P(z|\theta)}\frac{P(z|X,\theta_n)}{P(z|X,\theta_n)})-lnP(X|\theta_n)[/img]
[img]http://latex.codecogs.com/gif.latex?=ln(\sum_z{P(z|X,\theta_n)\frac{P(X|z,\theta)P(z|\theta)}{P(z|X,\theta_n)})-lnP(X|\theta_n)[/img]
[img]http://latex.codecogs.com/gif.latex?\ge\sum_z{P(z|X,\theta_n)}ln({\frac{P(X|z,\theta)P(z|\theta)}{P(z|X,\theta_n)})-lnP(X|\theta_n)[/img]
[img]http://latex.codecogs.com/gif.latex?\ge\sum_z{P(z|X,\theta_n)}ln({\frac{P(X|z,\theta)P(z|\theta)}{P(z|X,\theta_n)P(X|\theta_n)})[/img]
[img]http://latex.codecogs.com/gif.latex?\doteq\Delta(\theta|\theta_{n})[/img]
其中由于[img]http://latex.codecogs.com/gif.latex?\sum_z{P(z|X,\theta_n)=1[/img]
所以有:
[img]http://latex.codecogs.com/gif.latex?P(X|\theta_n)=\sum_z{P(z|X,\theta_n)}ln{P(x|\theta_n)}[/img]
我们可以写作:
[img]http://latex.codecogs.com/gif.latex?L(\theta)\ge{L(\theta_n)+\Delta(\theta|\theta_n)}[/img]
为了方便,我们定义:
[img]http://latex.codecogs.com/gif.latex?l(\theta|\theta_n)\doteq{L(\theta_n)+\Delta(\theta|\theta_n)}[/img]
这样我们得到
[img]http://latex.codecogs.com/gif.latex?L(\theta)\ge{l(\theta|\theta_n)}[/img]

现在我们得到了似然函数[img]http://latex.codecogs.com/gif.latex?L(\theta)[/img]的下界[img]http://latex.codecogs.com/gif.latex?{l(\theta|\theta_n)}[/img]
另外我们观察到:
[img]http://latex.codecogs.com/gif.latex?{l(\theta_n|\theta_n)}[/img]
[img]http://latex.codecogs.com/gif.latex?=L(\theta_n)+\Delta(\theta_n|\theta_n)=L(\theta_n)+\sum_z{P(z|X,\theta_n)ln\frac{P(X|z,\theta_n)P(z|\theta_n)}{P(z|X,\theta_n)P{X|\theta_n)}}[/img]
[img]http://latex.codecogs.com/gif.latex?=L(\theta_n)+\sum_z{P(z|X,\theta_n)ln\frac{P(X,z|\theta_n)}{P(X,z|\theta_n)}=L(\theta_n)+\sum_z{P(z|X,\theta_n)ln1=L(\theta_n)[/img]
所以当[img]http://latex.codecogs.com/gif.latex?\theta=\theta_n[/img]时,
[img]http://latex.codecogs.com/gif.latex?{l(\theta|\theta_n)}=L(\theta)[/img]

所以任何能够增加[img]http://latex.codecogs.com/gif.latex?{l(\theta_n|\theta_n)}[/img]的[img]http://latex.codecogs.com/gif.latex?\theta[/img]都会增加[img]http://latex.codecogs.com/gif.latex?L(\theta)[/img]
所以EM算法选择最大化[img]http://latex.codecogs.com/gif.latex?{l(\theta_n|\theta_n)}[/img]

最终我们得到:
[img]http://latex.codecogs.com/gif.latex?\theta_{n+1}=argmax_{\theta}\{l(\theta|\theta_n)\}[/img]
[img]http://latex.codecogs.com/gif.latex?=argmax_\theta\{\L(\theta_n)+\sum_z{P(z|X,\theta_n)}ln({\frac{P(X|z,\theta)P(z|\theta)}{P(z|X,\theta_n)P(X|\theta_n)})\}[/img]
去掉相对于[img]http://latex.codecogs.com/gif.latex?\theta[/img]的常量得到:
[img]http://latex.codecogs.com/gif.latex?=argmax_\theta\{\sum_z{P(z|X,\theta_n)}ln(P(X|z,\theta)P(z|\theta)\}[/img]
[img]http://latex.codecogs.com/gif.latex?=argmax_\theta\{\sum_z{P(z|X,\theta_n)}ln\frac{P(X,z,\theta)}{p(z,\theta)}\frac{P(z,\theta)}{p(\theta)}\}[/img]
[img]http://latex.codecogs.com/gif.latex?=argmax_\theta\{\sum_z{P(z|X,\theta_n)}ln(P(X,z|\theta)\}[/img]
[img]http://latex.codecogs.com/gif.latex?=argmax_\theta\{E_{Z|X,\theta_n}\{lnP(X,z|\theta)}\}[/img]

所以EM包含以下迭代步骤:
1、E-step: 得到条件期望[img]http://latex.codecogs.com/gif.latex?E_{Z|X,\theta_n}\{lnP(X,z|\theta)}[/img]
2、M-step:求解[img]http://latex.codecogs.com/gif.latex?\theta[/img]最大化该条件期望
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值