Re: [ROOT] Meaning errors TGraph::Fit

From: Edmond Offermann (edmondoffermann@yahoo.com)
Date: Fri Sep 19 2003 - 19:51:25 MEST


Hi Dario,

Your observations are just what one should expect :-)
. 
Let me explain:

TGraph-> (and (!) TGraphErrors->) Fit are special
implementations of TMinuit calls. To be more
specific, the objective function chosen in TGraph is
the chisquare , so Gaussain statistics, where
TMinuit can take any.

In Gaussian stat the expectation value for Chisquare
is the degrees of freedom: amin/ndf = 1.
So what physicists often do is rescale the fit
parameter error with sqrt(amin/ndf) which is the
same as rescaling your data errors with that factor so
that one would get a reduced chisquare of one.

In case one uses TGraph and no errors are given,
assuming all weights (errors) are the same, the
data error estimate is indeed chosen such that 
sqrt(amin/ndf) = 1.

Below I list the part of Fit where it is all
happening:

//*-*- Get return status
   char parName[50];
   for (i=0;i<npar;i++) {
      grFitter->GetParameter(i,parName, par,we,al,bl);
      if (!fitOption.Errors) werr = we;
      else {
        
grFitter->GetErrors(i,eplus,eminus,eparab,globcc);
         if (eplus > 0 && eminus < 0) werr =
0.5*(eplus-eminus);
         else                         werr = we;
      }
      if (!hasErrors && ndf > 1) werr *=
TMath::Sqrt(amin/(ndf-1));   <=== HERE !!!
      f1->SetParameter(i,par);
      f1->SetParError(i,werr);
   }

What one maybe could do is specify a separate
Fit function for TGraphErrors where this rescaling
is not happening, so more in line with the usual
TMinuit.

Eddy

--- Dario Motta <motta@mpi-hd.mpg.de> wrote:
> Dear rooters,
> I have my data in form of a TGraph object and I fit
> them with a
> user-defined function, indeed a simple double
> exponential function
> defined as:
> total = new TF1("total","expo(0)+expo(2)",5,100).
> I don't have so far a good estimation of the
> data-points error, but I
> surprisingly found that the errors on the fit
> parameters estimated by
> MINUIT (called by TGraph::Fit) are perfectly
> "reasonable" and independent
> on the normalization of the graphic (i.e. on any
> arbitrary weight factor
> with which I multiply my y-values). In addition I
> find that the errors on
> the parameters printed out by MINUIT on the screen
> (which indeed do depend
> on normalization factors!) are different from those
> returned by
> fift->GetParError(), that I use.
> I conclude that some special algorithm might be
> called to estimate default
> errors and to calculate parameters errors. Is my
> interpretation correct?
> If so, can I have some more information on the
> algorithm implemented?
> 
> I use ROOT 3.04 on a linux PC.
> 
> Thanks,
> 
> Dario Motta
> 
> 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:15 MET