How does minuit treat data point with zero error

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?

{
gStyle->SetOptFit(1111);
TGraphErrors *g1=new TGraphErrors();
TGraphErrors *g2=new TGraphErrors();

for(Int_t i=0;i<360;i+=10){
g1->SetPoint(i/10,i,sin(Double_t(i)*TMath::DegToRad()));
g2->SetPoint(i/10,i,sin(Double_t(i)*TMath::DegToRad()));
g1->SetPointError(i/10,0,0.1);
g2->SetPointError(i/10,0,0.1);
}
g2->SetPoint(36,45,0);
g2->SetPointError(36,0,0);

TF1 fit=new TF1(“fit”,"[0]sin(xTMath::DegToRad())",0,360);
TCanvas c=new TCanvas();
c->Divide(1,2);
c->cd(1);
g1->Draw("A
");
g1->Fit(“fit”);
c->cd(2);
g2->Draw("A
");
g2->Fit(“fit”);

}

Could you clarify which version of ROOT you use?
I do not see any problems with your script running 5.17/02

Rene

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.

Rene

Hi Rene,

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!
Carlos

Hi,

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
TFitter::GraphFitChisquare .
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 .

Eddy

Thanks Eddy, this is what is really happennig.