How to fit a multiple gaussian in a curve with a multiple peaks

Here is the curve and I have the gauusian equation with 27 parameter and one offset offset, so how can I do that?
how can I do a curve fit ?

5 commentaires

Do you mean this is a curve where 27 Gaussians are superimposed? What have you tried so far? Do you have the curve fiting toolbox?
njood alsaihati
njood alsaihati le 1 Déc 2018
Modifié(e) : njood alsaihati le 1 Déc 2018
no I mean I have a guassian function with 27 parameters that fit the curve.
Yes I have a fiting toolbox
Adam Danz
Adam Danz le 1 Déc 2018
Modifié(e) : Adam Danz le 2 Déc 2018
The Gaussian function has 3 main parameters (amplitude, width, and center). Add a vertical offset and you've got 4 parameters. So your function with 27 params must be a heavily modified guassian. One possibility is that it's a mixture of Gaussians which could be used to fit a curve with multiple guassian-like peaks.
you are right, I have a 27 params and one offset because there are 9 peaks in the curve. So how could I do that ?
Thanks
There are lots of nonlinear curve fitting tools available in matlab. Rik Wisselink asked you if you have the curve fitting toolbox, that would be a good place to start.
Curve fitting works like this. You state the function that the curve should take and for each parameter in the function, you state a reasonable range of parameters to test (sometimes optional). You also state a starting point within those ranges. Lots and lots of combinations of parameter values are tested until the error between your data and the fitted curve reaches a minimum. The output are a set of parameters for the function you enterd that produces the best fit curve.
Your results depend on 1)the function you specified, 2) the bounds you specified, and 3) the starting points you specified. Often times you have to try lots of different bounds, starting points, or functions before your fitted curves look reasonable so this usually isn't a simple once-and-done process.
As Rik suggested, start with understanding how to use the curve fitting toolbox (link) or lsqcurvefit (link) and work through examples found within the documentation. When you hit a rough spot and have a specific quesiton, use this forum for help. But until you have a specific question, it's difficult to help.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by