How to fit a curve using a mixture of gaussians to determine bimodality
2 views (last 30 days)
Show older comments
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!
0 Comments
Accepted Answer
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
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.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!