I am supposed to find parameters of individual gaussians in a 1D mixture with a known number of components. I use my own implementation of EM algorithm; however, I am not able to find the right solution.
Data
Number of points: 5057
Number of components: 5
Problem
Everytime I launch the algorithm, all resulting component's means are values from 161 to 163 (That is between the first two and largest peaks).
Here are my results from individual steps of one run of EM: output
Here is my implementation of EM in C++: EM
Update
Pat, you were right, thank you for your help.
- I forgot to multiply each item of product by posterior probability
- I had mistake in log likehood function