Skip to content

Instantly share code, notes, and snippets.

@tanutarou
Created September 23, 2017 11:09
Show Gist options
  • Save tanutarou/3459c0141fe9a96f0c9733cdec3ff0c6 to your computer and use it in GitHub Desktop.
Save tanutarou/3459c0141fe9a96f0c9733cdec3ff0c6 to your computer and use it in GitHub Desktop.
EMアルゴリズムのメモ 「ベイズ推定とグラフィカルモデル:コンピュータビジョン基礎1 セクション7」 ref: http://qiita.com/tanutarou/items/de149f39a52a4c207e3f
\begin{eqnarray}
\sum_i \sum_{k=1}^K q_i(z_k)\ln \left[\frac{p(x_i, z_k|\theta)}{q_i(z_k)} \right] &=& \sum_i \sum_{k=1}^K q_i(z_k)\ln \left[ \frac{p(z_k|x_i,\theta)p(x_i|\theta)}{q_i(z_k)} \right] \\
&=&\sum_i \sum_{k=1}^K q_i(z_k)\ln \left[ p(x_i|\theta) \right] + \sum_i \sum_{k=1}^K q_i(z_k) \ln\left[ \frac{p(z_k|x_i, \theta)}{q_i(z_k)} \right] \\
&=& \sum_i \ln \left[ p(x_i|\theta) \right] +\sum_i \sum_{k=1}^K q_i(z_k) \ln \left[ \frac{p(z_k|x_i, \theta)}{q_i(z_k)} \right]
\end{eqnarray}
\begin{eqnarray}
\hat{\theta} &=& \mathop{\rm arg\,max}\limits_{\theta} \sum_i \sum_{k=1}^K q_i(z_k) \ln \left[ \frac{p(x_i, z_k | \theta)}{q_i(z_k)} \right] \\
&=& \mathop{\rm arg\,max}\limits_{\theta} \sum_i[ \sum_{k=1}^K q_i(z_k) \ln p(x_i, z_k | \theta) - \sum_{k=1}^K q_i(z_k)\ln q_i(z_k) ] \\
&=& \mathop{\rm arg\,max}\limits_{\theta} \sum_i[ \sum_{k=1}^K q_i(z_k) \ln p(x_i, z_k | \theta) ]
\end{eqnarray}
\theta^{new} = \mathop{\rm arg\,max}\limits_{\theta} Q(\theta, \theta^{old}) \\
Q(\theta, \theta^{old}) = \sum_Z p(Z|X, \theta^{old}) \ln p(X,Z|\theta)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment