How to fit a curve using a mixture of gaussians to determine bimodality

2 views (last 30 days)
Hello there,
I have a curve which I want to fit using a mixture of two gaussians. I have checked fitgmdist but that expects the data, rather than curve (i.e. hist). Ultimately, I need to determine if my curve has two or one peak. I thought one way of determining this was to see how good was a fit of a mixture of two gaussians compared to only using one (2 component vs 1 component).
Is there a way to fit a mixture of gaussians to a curve? I do not have the curve fitting toolbox. Alternatively, what other ways of determining if the curve has one or two prominent peaks? I am currently using findpeaks a minHeight threshold but it does not seem very elegant.
Any ideas?
Thanks!

Accepted Answer

Image Analyst
Image Analyst on 20 Nov 2018
Edited: Image Analyst on 20 Nov 2018
If you have the Statistics and Machine Learning Toolbox, you can try the attached demo I wrote.
Adapt as needed.
To determine if it's one peak or two, you might use the well known Rayleigh Criteria Wikipedia
  2 Comments
Edgar
Edgar on 23 Nov 2018
Thank you for the answer ! I will adapt it.
I am very interested on your last comment. I am not quite sure how to use the Rayleigh criteria for this type of curves. Any idea where to read about it (apart from the wikipedia page about angular resolution and optics)?
Image Analyst
Image Analyst on 23 Nov 2018
It's a very very common concept in optics. It determines the optical resolution of a system. When two point sources of light are that close together, people can no longer recognize them as two separate point sources of light - they look like a single point source. I'm sure a Google search would bring up lots of info on it.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!