How to fit multiple curves to histogram subpopulations?

18 次查看(过去 30 天)
Hello, I will be as succint as possible. I have a histogram and would like to fit two seperate curves to the distribution, representing the two subpopulations in the distribution. Essentially I would like to do this (red lines I drew):
How can I do this?
Note that these arent two seperate histograms, but rather a single histogram.
My code for this histogram is here:
%%
figure;
d1=histogram(dG_TfR_100, [0: .3: 25], 'Normalization' ,'probability'); %range of current drops
ylabel('normalized event count')
I have also attached the variable dG_TfR_100 as an excel sheet in case it is needed.
Please let me know if there is any additional information you need. Thank you.

回答(1 个)

AndresVar
AndresVar 2022-2-11
编辑:AndresVar 2022-2-11
You could fit a distribution to the histrogram using histfit or fitdist, then identify the number of modes or peaks, N. Then fit the distribution with the sum of N distributions, with carefully selected parameters:
Curve Fitting - MATLAB & Simulink (mathworks.com) to fit your choice of components
You can try this method that fits gaussian mixture model, it works like a k-means clustering:
Browse file exchange for helpful functions:
Here is a gaussian decomposition paper

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by