Gaussian mixture curve fitting

조회 수: 19 (최근 30일)
Nagaraj
Nagaraj 2014년 11월 10일
댓글: Jaroslav Hook 2020년 7월 17일
How does one curve fit a 2 dimensional gaussian mixture to data? I know that the function 'gmdistribution.fit' models the data as a multidimensional gaussian mixture, but I want to do curve fitting instead. I tried using the 'nlinfit.m' function by writing my own model function but I run into errors because I cannot constrain the co variance matrix to be positive semi definite.
  댓글 수: 2
the cyclist
the cyclist 2014년 11월 10일
편집: the cyclist 2014년 11월 10일
Do you mean one-dimensional data ("x") that is fit by the sum of two component gaussians in that dimension, or do you mean two-dimensional data ("x" & "y") fit by one (or more?) gaussian(s) in each dimension?
Nagaraj
Nagaraj 2015년 3월 10일
편집: Nagaraj 2015년 3월 10일
My data is a 2D matrix with the indices representing the x and y variables and the matrix values representing the height of the surface. I need to "surface fit" 2D gaussian mixtures(upto 6 mixtures) to this data. Any suggestions? The inbuilt parametric modeling function http://www.mathworks.com/help/curvefit/parametric-fitting.html gives the option for fitting gaussian mixtures curves(1D case). Is there something similar in the 2D case to fit surfaces?

댓글을 달려면 로그인하십시오.

답변 (2개)

the cyclist
the cyclist 2015년 3월 10일
I don't have any experience doing this in MATLAB, but it sounds to me like the fit function in the Curve Fitting Toolbox is exactly what you need.
That page shows a simple example of fitting a surface. Your case would be a bit more complicated, because you want to fit a custom function, but it seems that this is possible.

Edgar
Edgar 2018년 11월 20일
Hello there,
I have a curve which I want to fit using a mixture of two gaussians. As in the original question, I have checked fitgmdist but that expects the data, rather than curve fitting.
Is there a way to fit a mixture of gaussians to a curve? I do not have the curve fitting toolbox.
Any ideas?
Thanks!
  댓글 수: 2
Image Analyst
Image Analyst 2018년 11월 20일
See attached demo.
0000 Screenshot.png
Jaroslav Hook
Jaroslav Hook 2020년 7월 17일
This wors fine as long as the curves do not overlaps

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by