fitting sum of gaussians into a data set (100 rows and 1 column)
조회 수: 3 (최근 30일)
이전 댓글 표시
Getting difficulty in fitting and plotting a data set (100x1 matrix) by using gmdistribution.fit....i have to git a large number of sum of gaussians...but i guess it needs a matrix with mu and sigma values...can anyone help me in fitting this data into sum of gaussians and plotting it..i want a one dimensional plot... thanks
댓글 수: 0
채택된 답변
Pourya Alinezhad
2013년 6월 10일
you can use the function "lsqcurvefit".first define Gaussian formula in a function mfile.then the lsqcurvefit function gives the fitted data .
댓글 수: 3
Pourya Alinezhad
2013년 6월 10일
what is your understanding that "large number of gaussians"? if there is multiple qaussian functions with variable mu and sigma values you can do so for every of them and then interpolate the results to have one dimentional plot or take an average between the results.
추가 답변 (1개)
Alan Weiss
2013년 6월 14일
편집: Alan Weiss
2013년 6월 14일
As clearly stated in the Input Arguments section of the documentation, you should not return the sum of squares, but should return a vector of values for your objective function. Making a sum of squares as you have done slows or stops convergence.
I am not sure that I understand your formulation completely, but perhaps you should check a similar sort of example in the documentation.
Alan Weiss
MATLAB mathematical toolbox documentation
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!