<aside> 🎯 Goal

</aside>

<aside> ☝ Dear 434 students:

I was deliberately slow in our lecture yesterday (April 30) because I believe understanding the EM problem formulation is the most crucial part. Why? Because only if you understand the formulation well, you will be able to map EM to various real-world problems that you face in industry or grad school. So I suggest you brainstorm about other problems where you might be able to apply EM; this exercise will give you clarity on what EM is really capable of doing.

Ok, that said … I wanted to finish yesterday’s lecture in this email by telling you at a (very) high level how the algorithm works (the math is in the notes below).

For balls and bins, we have: $p(bin_1 ~|~ red~ball ) = p(red~ball ~|~ bin_1) p(bin_1) / \sum_j p(red~ball ~|~ bin_j) p(bin_j)$

For our coin toss, we have: $p(z_i = 1 ~|~ x_i ) = \frac{p(x_i ~|~ z_i =1) p(z_i=1)}{ \sum_j p(x_i ~|~ z_i=j) p(z_i = j) }$

                                             $p(z_i = 2 ~|~ x_i ) ~~=~~ \\frac{p(x_i ~|~ z_i =2) p(z_i=2)}{  \\sum_j p(x_i ~|~ z_i=j) p(z_i = j) }$

                                             … and so on till …

                                             $p(z_i = k ~|~ x_i ) ~~=~~ \\frac{p(x_i ~|~ z_i =k) p(z_i=k)}{  \\sum_j p(x_i ~|~ z_i=j) p(z_i = j) }$
  1. Output $\theta_{1:k}$ as the last values of $\theta$’s that you have after convergence.
  2. Output for each $x_i$ the posterior distribution of $z_i$ … which you know. If your boss says you have to give a one-hot vector for $z_i$, then pick the value of $z_i$ that has maximum probability in the posterior and output that.

YOU ARE DONE.

p.s. I might have incorrectly written the LOTUS equation in class. Here is the correct LOTUS equation:

<aside> <img src="/icons/library_red.svg" alt="/icons/library_red.svg" width="40px" /> Tutorial by Dahua Lin (MIT): here

</aside>