本日はEMアルゴリズムについてお話ししようと思います。「EMアルゴリズム?」と思った方へ先に簡単に紹介すると
Expectation-Maximization Algorithm
の略で、潜在変数(Z)を用いて、iterativeに尤度最大化を行う手法です。iterativeというのはE-step、M-stepと言われる2種類を交互に行い尤度を最大化し、パラメータを決定します。2ステップに分けて行うことがミソなんですけれど数式ゴリゴリすると途中で自分が何をやっていたかわからなくなるんですよね。その点に注意しながら進めていこうと思います。Notation
個の独立なデータ(observable)、
- モデルのパラメータ、
- 潜在変数(unobservable)、
![Rendered by QuickLaTeX.com \sum_z Q_i(z)=1,Q_i(z)\geq 0](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-45e1f64549ab2f76f85843c24dd0d0a2_l3.png)
![Rendered by QuickLaTeX.com Q](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-2c758bec4c272382411b95fc0e7ee250_l3.png)
![Rendered by QuickLaTeX.com f](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-9c09a708375fde2676da319bcdfe8b24_l3.png)
![Rendered by QuickLaTeX.com I](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-18b5e45cb4a1ee02e81b9a980f828db8_l3.png)
,
![Rendered by QuickLaTeX.com Q](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-2c758bec4c272382411b95fc0e7ee250_l3.png)
![Rendered by QuickLaTeX.com \sum_z Q_i(z^{(i)}) = 1](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-aa41d1fec529a995da507335ee095acb_l3.png)
![Rendered by QuickLaTeX.com Q](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-2c758bec4c272382411b95fc0e7ee250_l3.png)
- 潜在変数
の事後確率計算
- パラメータ
の更新
![](https://research.miidas.jp/wp-content/uploads/2019/02/Screen-Shot-2019-02-24-at-19.58.01-1024x734.png)
では、コレで下界の最大化ができたことになりますがその際、本来の目的関数、つまり
![Rendered by QuickLaTeX.com l(\theta)](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-64095ba305c5c63151fa6b54d9d75b95_l3.png)
![Rendered by QuickLaTeX.com t](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-b4e3cbf5d4c5c6d9b702dd139f14c147_l3.png)
![Rendered by QuickLaTeX.com \theta^{(t)}, \theta^{(t+1)}](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-2f6d457e66bf8b4dd500cb5aedd96383_l3.png)
![Rendered by QuickLaTeX.com Q_i^{(t)}(z^{(i)}) := p(z^{(i)}|x^{i},\theta^{(t)})](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-00a6683bc9f86396d484ce80af51b329_l3.png)
EMとKL
先ほどのこの式
![Rendered by QuickLaTeX.com Q(Z) = p(Z|X;\theta)](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-39dd2c6bbcea8e350158ed41929b0602_l3.png)
今回はEMアルゴリズムをもとに数式をずらずらとやってみました。日本の大学はレジュメも講義もほとんど公開してないですね、、
References
- https://www.cs.utah.edu/~piyush/teaching/EM_algorithm.pdf
- http://www.princeton.edu/~amirali/Public/Teaching/ORF523/S16/ORF523_S16_Lec7_gh.pdf
- http://pianopiano.sakura.ne.jp/ml/em-algorithm/
- https://oimeg.blogspot.jp/2015/07/em.html
- https://en.wikipedia.org/wiki/Convex_function
- https://mathtrain.jp/jensen_proof
- http://cs229.stanford.edu/notes/cs229-notes8.pdf
- https://math.stackexchange.com/questions/628386/when-jensens-inequality-is-equality
- https://qiita.com/kenmatsu4/items/59ea3e5dfa3d4c161efb
- https://math.stackexchange.com/questions/247795/what-is-the-covariance-of-mixture-bernoulli-distribution