# Separating the populations in a bimodal distribution

I have a data set which displays a bimodal distribution. This was determined by plotting a histogram of the frequency vs number.

I now need to separate the two original populations and therefore find an intersection point of sorts. From the plot it looks like the point might be approx. -1.0 to -0.8.

Is there a straight forward calculation or function that I can use to locate this point more accurately?

• Have you ever heard of finite mixture modeling? You may think of the observed distribution as a mixture of two distributions, and you can make inference about where the "split" occurs within this framework. – Macro Apr 21 '12 at 15:48
• Hi Macro. Thanks for the idea. It sounds like something that would work but in looking it up it seems pretty complex. I'm no stats wizz so really after something simple here, even if it's an approximation. – Carl Apr 22 '12 at 2:56
• Well, you could move the threshold for the "split", and optimize the resulting likelihood. The likelihood may be non-differentiable in the threshold, but it's just a one-dimensional line search so you should be able to use derivative-free methods for the optimization. – Macro Apr 25 '12 at 15:26
• Thanks for the help Marco. I ended up finding a programatic solution (running under Linux) which works quite well, especially for this type of data (i.e. astronomy related). Would it be accepted if I post the details of that as an answer? What's the etiquette? – Carl Apr 26 '12 at 11:30
• If you've found a satisfactory solution, I'd suggest posting it as an answer and accepting your own answer :) – Macro Apr 26 '12 at 12:05

Actually that algorithm sounds like it is using precisely the methodology that Macro was suggesting. The idea is that you have a distribution $$F(x)=pF_{1}(x)+(1-p)F_{2}(x)$$ where $F_1$ and $F_2$ are specified up to a few parameters that are estimated from the data. In your case $F_1$ and $F_2$ are both Gaussian and there would be 5 parameters to estimate from the data, $p, σ_1, σ_2, μ_1$, and $μ_2$ the mixture proportion and the standard deviations and means respectively for the distributions $F_1$ and $F_2$. There is actually no unique separation point since the distributions overlap. But the algorithm probably picks the crossing point for the densities. Since these are Gaussian distributions there will only be one unless one has a very large variance compared to the other. Without knowing the algorithm, I wouldn't know how many of these parameters are estimated. For example both standard deviations could be estimated or they could be assumed equal and only a pooled standard deviation would be estimated. 5 parameters estimated in the first case and 4 in the second. After the parameters of $F_1$ and $F_2$ are estimated you use the distributions specified by the estimates to calculate the crossing point.

• Can you clarify what you mean by "Since these are [Gaussian] distributions there will only be one unless one has a very large variance compared to the other"? Are you speaking of the densities? If you have any two continuous strictly positive densities $f_1$ and $f_2$ with unbounded support, how can you not have at least one intersection point? – cardinal May 21 '12 at 17:13
• @cardinal Usually the densities will only cross in one place (where the right hand tail of one meets the left hand tail of the other). But say the one on the right has a very large variance so that the density is very spread out then it can cross at both the right hand tail (dropping below as you move left and then the lefthand tail crossing above. I didn't say that they couldn't intersect. I just meant that the intersection point need not necessarily be the point you want to define as the separation point. – Michael R. Chernick May 21 '12 at 17:49
• If they both terminate without crossing then there is a welldefined separation interval or point. – Michael R. Chernick May 21 '12 at 17:49
• Sorry, Michael. Even though I read it three times at least, my eyes skipped over only each time. – cardinal May 21 '12 at 18:02

For anyone else interested, I used Gaussian Mixture Modeling (GMM) algorithm to determine the means of the two populations and separate them.

You can use the Otsu's method, you can think at your histogram as the histogram of the grey values of pixels in an image.

Then, in computer vision and image processing, Otsu's method, named after Nobuyuki Otsu (大津展之 Ōtsu Nobuyuki)1, is used to automatically perform clustering-based image thresholding, or, and that is your case, the reduction of a graylevel image to a binary image.

The algorithm assumes that the image contains two classes of pixels following bi-modal histogram (foreground pixels and background pixels), it then calculates the optimum threshold separating the two classes so that their combined spread (intra-class variance) is minimal, or equivalently (because the sum of pairwise squared distances is constant), so that their inter-class variance is maximal.

1Otsu, Nobuyuki. "A threshold selection method from gray-level histograms." IEEE transactions on systems, man, and cybernetics 9.1 (1979): 62-66.

You can use the check to "normality" (there are many packages): The algorithm is simple: split var into bins. count the number of observations and the expected, take the difference, standardize by expected. The bin in which we have the min of standardized res - will contain the desired optimal threshold for dichotomisation! (2 bins with max stdRes= modes of yours 2 distributions ;-). Don't fogot play with (try) differrent bin numbers! Next you try to clarify within this interval via model selection (KLIC/CAIC/BIC/etc).

When we talk about a modal, some of the explanations you'll find on the web conflate modal with a mode, but actually, each normals comprising the bimodal has its own mode, median, and mean. If there is enough data points under each of the normals, there won't be any skew involved. So take those peaks to be the mode, median and mean.

This implies that the footprints are circles. The normals would be symmetric, so you have a center and a data value on the outer edge of the distribution related to its closest mean for each mean. That tells you how wide each normal would be. You would have enough information to determine the relative proportion of the total probability is contributed by each of the underlying normals.

When a normal does not yet have enough data points it exhibits skew. The footprint of a skewed normal is an ellipse. In a skewed normal, the median leans. It is not perpendicular. The median becomes perpendicular as the skew disappears. The angle between the baseline and the median drives the skew. The sin of that angle equals the height. The median would be centered in the ellipse, so the median to the edge would give us enough information about the ellipses.

In a standard normal, the mean, median, and mode are in the same place. In the skewed normal, the median pushes the mean and mode apart symmetrically across a vertical line centered between mean and mode. In multimodal distributions, each modal has its own normal and its own mean, median, and mode. The same analysis applies to each of those normals.

Sometimes a large normal has a sublimated normal inside or under it. These will be hidden. If the sublimated normal is kurtotic is will make the aggregated normal oscillate. There are whole books on this subject. Enjoy.

• This is really hard to follow. What's a skewed normal? Or a sublimated normal? How are circles or ellipses relevant to univariate distributions? I've never to my recollection seen the term "modal" on its own, but the implication of bimodal etc. is that there are two etc. modes in a distribution, meaning well-defined peaks in terms of bin frequency and/or probability density. – Nick Cox Jan 5 '18 at 13:02
• When you start collecting your data, you don't have enough data to have a normal distribution. Until the point here you actually have a normal, the distribution will be skewed. We are used to the 2-D view of the normal. It could be a multidimensional normal, but we will still look at it via that 2-D view. If we took look at that 3-D view, the normal would look like a circle with the mean in the center. If that normal is skewed, it would look like an elipsis. – David W. Locke Jan 6 '18 at 4:54