Setting a bimodal distribution to a set of values

Given a 1D array of values, what is the easiest way to find out what the optimal bimodal distribution is for it, where each β€œmode” is a normal distribution? Or, in other words, how can you find a combination of two normal distributions that bests reproduce a 1D array of values?

In particular, I'm interested in implementing this in python, but the answers need not be language specific.

Thanks!

+6
python algorithm
source share
3 answers

What you are trying to do is called a Gaussian mixture. A standard approach to solving this issue is to use maximization of expectations, scipy svn includes a section on machine learning and em called scikits . I use it fairly honestly.

+4
source share

I suggest using awesome scipy . It provides several optimization methods.

There's a big fat warning just applying a predefined least square match or something like that.

Here are a few problems you will encounter:

  • Noise is higher than the second / both peaks.
  • Partial peak - your data is cropped on one of the borders.
  • Sampling - peak widths are smaller than your data.
  • This is not normal - you will get some result ...
  • Overlap. If the peaks overlap, you will find that often one peak is set correctly, and the second will be completed with zero ...
0
source share

I'm just trying to understand why a bimodal distribution is needed for a 1D array? What are the benefits of this?

0
source share

All Articles