Clear Filters
Clear Filters

How does matlab's gaussian fit function select peak centers

3 views (last 30 days)
I have a series of data traces that represent change in two gaussian peaks over time. Each trace varies a little from the others due to noise but at least visually the two peaks are clearly visible at every time step. When I perform a "gauss2" fitting on the data occasionally it manages to successfully identify the two peaks and fit them well. Most time steps it seems to select the second peak far too close to the first peak and so instead of two clearly separated peaks it gives me a single big peak with a long tail. I think the problem is that it's failing to select the second peak center properly, so I was wondering how the "fit" program does that and how this might be resolved.
Thanks all

Answers (2)

Kushagr Gupta
Kushagr Gupta on 8 Jun 2017
Looking at the graphs, it seems that the kernel size being used is too large. In such a case, large amount of neighborhood data is being used to come up with the fit.
You would have to modify some of the parameters to get the desired result. As "gauss2" uses NonLinear LeastSquares method, I feel changing (reducing) the value of "DiffMaxChange" should give a better result. Lowering the "Span" field value can also help in getting the second peak but it depends on what fit type is being used.
I would recommend playing around with the different algorithms available and tweaking their settings to get a desired result.

Gaurav
Gaurav on 6 Dec 2017
James,
Could you solve the problem and share the solution?

Products

Community Treasure Hunt

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

Start Hunting!