EM for Estimating k Means
- EM Algorithm: Pick random initial $h = \langle \mu_1, \mu_2 \rangle$, then iterate
- E step: Calculate the expected value $E[z_{ij}]$ of each hidden variable $z_{ij}$,
assuming the current hypothesis $h = \langle \mu_1, \mu_2 \rangle$ holds.
\[
\array{ E[z_{ij}] & = & \frac{p(x=x_i \,|\, \mu = \mu_j)}{\sum_{n=1}^{2} p(x = x_i \,|\, \mu=\mu_n)} \\
& = & \frac{e^{-\frac{1}{2 \sigma^2} (x_i -
\mu_j)^2}}{\sum_{n=1}^{2} e^{-\frac{1}{2 \sigma^2} (x_i - \mu_n)^2}}
} \]
- M step: Calculate a new maximum likelihood hypothesis $h' = \langle \mu_1', \mu_2'
\rangle$, assuming the value taken on by each hidden variable $z_{ij}$ is
its expected value $E[z_{ij}]$ calculated above. Replace $h =
\langle \mu_1, \mu_2 \rangle$ by $h' = \langle \mu_1', \mu_2' \rangle$.
\[ \mu_j \leftarrow \frac{\sum_{i=1}^m E[z_{ij}] x_i}{\sum_{i=1}^m E[z_{ij}]} \]
José M. Vidal
.
35 of 39