I have an array of 1-dimensional data that I'd like to fit a Gamma mixture model two. The data is drawn from two Gamma distributions. I've implemented EM for Gamma distributions, and it works as long as I only fit one distribution to the data.
However, when I try to fit two distributions, the algorithm converges to a solution with one distribution with weight 1 (sort-of fitting to all of the data) and one distribution with weight 0. This happens even when I supply initial parameters that I found by fitting a Gamma function to each part of the data in isolation, and even when I artificially add "space" between the two underlying distributions, so that they are well-separated.
I thought that it would be easy to find ready-made implementations of EM for different kinds of PDFs, but it seems that all packages I've found are for Gaussian distributions only. And since my own implementation doesn't give the expected result either, I ask:
Is it possible to do Expectation Maximization to find the parameters of a mixture of Gamma distributions?