Failure Fitting Puzzles

Hi! I am fitting several groups of TGraphs and in order to express more conveniently, we assume there are three groups of TGraphs. Each of group contains 16 small canvases which are fitted by asym-Gauss function. Several canvases from the three groups of data can be successfully fitted and fitted curves have been drawn. The fitting of other canvases with points distributed in a straight line failed naturally. However, I have encountered the following problem:

  1. The No.2 and No,10 canvas of the first group are fitted successfully, and the No.5 canvas of the second group is fitted successfully. However, when I record the fitting parameters and draw the fitting curve, the two successfully fitted canvases of the first group are also drawn in the corresponding small canvases of the second group, which are the second and tenth canvases. The corresponding small canvases of the second group (No.2 and No,10) can’t be fitted because of the linear points distribution. All of their (i.e. No.2 and No,10 of the first group, No.5 of the second group) fitting asym-Gauss function are also drawn on the third group.

  2. Another strange thing is the points of No. 2 canvas of the third group can be fitted, the new fitting results have been correctly drawn on the canvas, covering the results from the first graph. But incorrect fitting results from the first two groups were drawn in the corresponding small canvas in third group.

Why Failure Fitting can’t give us parameters with the zero value? Instead, it read the fitting results of the previous group of corresponding positions. And the correct result after successful fitting covers the previous incorrect result.

Welcome to the ROOT Forum!
I think we might need a reproducer to understand better what you describe. But maybe @moneta or @couet can take a look nevertheless

As Bertrand said, we will need a reproducer showing your problem.

Thank you for your enthusiastic response. As these codes involve scientific research projects, as one of them, I could not decide whether I can share them

May be I want to figure out some features of fitting output to solve these problem.

If the fitting failed, what will we obtain from the fitting function?

I think it depends on the way you fit your data. Maybe @moneta or @jonas can give some hints

The data structure is simple. There are totally 64 points in one TGraph (small Canvas). And I use a function (Double type) to define the express of AsymGauss. After points information is Setpoint into a TGraph, directly graph->Fit(). Finally, Fitfunction->GetParameter(), to obtain the fitting results.

The fit function will continue the parameter values obtained from the last minimization iteration. However, these are values that sometimes do not make any sense and you should not restart a fit from those values.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.