期望极大
EM 算法
\(\operatorname{EM}\) 算法通过迭代求 \(L(\theta) = \log P(Y | \theta)\) 的极大似然估计。每次迭代包含两步:\(\operatorname{E}\) 步,求期望;\(\operatorname{M}\) 步,求极大化。
算法步骤
输入:观测变量数据 \(Y\),隐变量数据 \(Z\),联合分布 \(P(Y, Z | \theta)\),条件分布 \(P(Z | Y, \theta)\); 输出:模型参数\(\theta\)。
(1)选择参数初始值 \(\theta^{(0)}\),开始迭代;
(2)\(\operatorname{E}\) 步:计算 Q 函数值
\[ Q(\theta, \theta^{(i)}) = \sum_{Z} \log P(Y, Z | \theta) P(Z | Y, \theta^{(i)}) \tag{1} \]
这里,\(P(Z | Y, \theta^{(i)})\) 是在给定观测数据 \(Y\) 和当前的参数估计 \(\theta^{(i)}\) 下隐变量数据 \(Z\) 条件概率分布;
(3)\(\operatorname{M}\) 步:求使 \(Q(\theta, \theta^{(i)})\) 极大化的 \(\theta\),确定第 \(i + 1\) 次迭代的参数估计值 \(\theta^{(i + 1)}\)
\[ \theta^{(i + 1)} = \operatorname{arg} \max_{\theta} Q(\theta, \theta^{(i)}) \tag{2} \]
(4)重复(2)(3)步直到收敛
期望极大
https://ddccffq.github.io/2025/06/03/机器学习方法/期望极大/