Use of fminsearch in logscale

1 view (last 30 days)
Studentskp
Studentskp on 27 Sep 2021
Edited: Matt J on 28 Sep 2021
I am trying to fit 3 Gaussians to data (a curve) and the model parameters of the gaussians (mu, std and amplitude) are obtained from a curve drawn on a logscale. i.e. losspace (-4,1, 100). I do not get a good match between the Gaussians and my data.
When the modelparameter are obtained from a curve darwn on a linear scale , it works fine. Using 'fminsearch'.
Any suggestions, please?
Thanks.

Answers (1)

Matt J
Matt J on 28 Sep 2021
Edited: Matt J on 28 Sep 2021
Well, that could make sense. On a log scale, much of your data could be either very far away from the central portion of the 3 Gaussian lobes or clustered very close together, and therefore don't provide very informative measurements. So, use a linear scale to sample the curves. Or, sample on the log scale more finely and apply weights to your objective function, so that the samples near the central lobes get more priority.
Also, fminsearch is probably not a good tool to use with the number of unknown variables that you have. You should probably use lsqcurvefit instead, ideally with SpecifyObjectiveGradient=true..

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!