I am wondering how does minuit treat data point with zero error.
The chi-2 should diverge unless minuit is programed to ignore
this data point automaticly.
However, the following sample macro demonstraits the zero error
data point leaves finite impact on the fitting result as if it is assigned
some large error instead of zero inside the minuit. Is my guess true?
TGraphErrors *g1=new TGraphErrors();
TGraphErrors *g2=new TGraphErrors();
TF1 fit=new TF1(“fit”,"sin(xTMath::DegToRad())",0,360);
TCanvas c=new TCanvas();
Could you clarify which version of ROOT you use?
I do not see any problems with your script running 5.17/02
Root version 4.04.
I get results of p0=1 without zero error data point, while
p0=0.9997 with zero error data point.
I can only suggest you to move to a more recent version.
I tried with your version 5.17/02 and it’s the same problem. Let me re-state the problem. When there is a point with zero error, it is somehow ignored in the fit: otherwise it should drive the fit completely as its weight is infinite. However, it is not ignored completely as the results changes from p0=1 for g1 and p0=0.99972 for g2 (in the example). We would like to know (if possible) how this point is treated exactly in the fit, i.e. which weight is associated with it, when the error bar is zero.
Thanks a lot!
If the user is careless and tries to feed a chisq fit a data point with
zero error, the designer of the code has to make a choice :
- kick out the data point
- use the data point with a best guess for the weight
- give an error message and do one of the two above
- kick the user
I would do number 4 but the author choose to …
Dig in the TGraph::Fit code and notice that the objective function chosen is
I see the following code :
958 eu = ey*ey+eux*eux;
959 if (eu <= 0) eu = 1;
960 f += fsum*fsum/eu;
To me this seems to amount to setting the total error to 1 if it is
<= 0 .
This would explain the fact that adding this point influences the
fit result .
Thanks Eddy, this is what is really happennig.