Hi there,
I’m currently trying to fit a TH1 by using the ROOT::Fit::Fitter class.
As minimization method I want to use the “Poisson likelihood chi-square” described in the well-known Baker-Cousins paper, such that the principal code looks like this:
ROOT::Fit::Fitter fitter;
fitter.SetFunction(WrappedFitFunction, false);
fitter.LikelihoodFit(BinData)
Up to a factor of 2, this is implemented in the extended Root LikelihoodFit by FitUtil::EvaluateLogL (root.cern.ch/doc/master/FitUtil … ource.html , line 1209).
However, after my fit, I’m wondering about the meaning of the minFCN and Chi2 value:
minFCN = 5041.89
Chi2 = 126.197
NDf = 42
minFCN is calculated in EvaluateLogL as
loglike = Sum_over_bins [theory(i) - data(i) + data(i)*ROOT::Math::Util::EvalLog(data(i)/theory(i))]
, such that the returned value in EvaluateLogL (nloglike) should be Chi2_P/2.
I tried to find the definition of the Chi2 in the source code, but I failed.
What is the Chi2 in Fitter::Result() and how is it calculated? It doesn’t look like the Poisson likelihood chi-square (or my conclusion about minFCN is wrong).
Thanks a lot!