un-mix a pdf

1 次查看(过去 30 天)
Rachel Allen
Rachel Allen 2021-3-19
I'm looking to find the 2 representative particle sizes (x-axis) of a particle size distribution (see attached fig). For a single reprentative particle size, I can compute the mean, or median. But, it looks like it is a mixture of two classes, and I'd like to find the "respresentative" particle size of each class. I thought that fitgmdist might help me here, but it looks like that function needs to start from raw values (not a pdf), and I have a pdf only.
In the figure, I think the answer I'm looking for is ~85 mum and 270 mum, the orange and yellow vertical lines. And tips on how to do this "unmixing"?
I'm
Thank you!
  3 个评论
Rachel Allen
Rachel Allen 2021-3-22
Thanks, I don't remember exactly which data set I used to make that last image, but here's the data for a new one:
the cyclist
the cyclist 2021-3-22
I haven't been able to get my idea to use fitnlm to work. :-(

请先登录,再进行评论。

回答(2 个)

Steven Lord
Steven Lord 2021-3-22
So you want the local peaks? Take a look at the islocalmax function.
  2 个评论
the cyclist
the cyclist 2021-3-22
I don't think it's just peak-finding. If the distribution is a mixture of two gaussians, the modes tend to get shifted closer toward each other than the means of each gaussian. Here is a contrived example where the gaussian means are at -1.1 and 1.1, but the modes look to be around -0.8 and 0.8.
x = -3 : 0.01 : 3;
pdf_L = normpdf(x,-1.1,1);
pdf_R = normpdf(x, 1.1,1);
pdf_sum = pdf_L + pdf_R;
figure
plot(x,pdf_sum)
Rachel Allen
Rachel Allen 2021-3-22
Thanks, I think this does illustrate it well. In addition, there are data sets like the figure attached, where it's easy to believe that there is a second peak, but it would be hard to find with a peak-finding function.

请先登录,再进行评论。


the cyclist
the cyclist 2021-3-22
I was doing a bit of searching on this forum, and I found this question, where @Image Analyst uploaded his Fit Multiple Gaussians code.
That function looks like it will do what you want. I struggled to adapt it to your data, but I'm not sure if I am just doing something silly at the end of a long day. But I think it's worth a look.
Note that that file is a demo that generates simulated data to illustrate the method. You won't need that part. You'll just need to insert your own.

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by