I would like to use a Gaussian mixture model to return something like the image below except proper Gaussians.
I'm attempting to use python sklearn.mixture.GaussianMixture
but I have failed. I can treat each peak as though it were the height of a histogram for any given x value. My question is: do I have to find a way to transform this graph into a histogram and remove the negative values, or is there a way to apply GMM directly onto this array to produce the red and green gaussians?
There is a difference between fitting a curve to pass through a set of points using a Gaussian curve and modeling a probability distribution of some data using GMM.
When you use GMM you are doing the later, and it won't work.
Now if what you want is to fit a Gaussian curve. Try the answer to this question.
Update on how to adapt the code for multiple gaussians: