How to set the parameters of the fit function?


Last week I get help that how to fit a unsymmetrical gaus distributing. Now I have another problem that how to set the parameters of the user-defined function. I try to do it ,but the fit result is not well. Please see my macro in attachment.
Please give me some advises. Thanks!!

doufit.c (880 Bytes)

With the data points of your graph, it looks hard to fit them with a double gaussian. The model is wrong.


If I want to fit my graph, what model should be use? Is there a convenient method? :slight_smile:


you should know better than us what your data represent and what is their model, i.e. what is the propability distribution describing your data.

Furthermore for fitting one would need to know the data errors.

If you don’t know the model you should do a smoothing of the data. See for example TGraphSmooth.

Best Regards


For my data, there is not a better model. I eager to get the width at half maximum each side of the maximum, so I want to fit my data with an unsymmetrical guas model which have different “sigma” at two sides of the “mean”.
I do not konw whether therer is a good method to get a good fit and achieve my aim.

Thanks for your advises!


To get a good fit you need first to estimate the errors on your data points.