Chi-square test for histogram fitted with Likelihood method

Daer experts,
I would like to know how the chi-square is computed when one tries to fit a histogram with “L” fit option.
I see that there are some references to the paper:

CLARIFICATION OF THE USE OF CHI-SQUARE AND LIKELIHOOD FUNCTIONS IN FITS TO HISTOGRAMS
Steve BAKER and Robert D. COUSINS

I implemented the formula written in the paper on page 439, but I get a different chi2 with respect to what is reported from ROOT at the end of the fit.

The formula in the paper says: 2 * sum[ yi - ni + ni * ln(ni / yi) ]

Many thanks for the clarification.
Kind regards,

  • Mauro.

Hi Mauro,

The Baker Cousins chi2 after a binned likelihood fit in ROOT is obtained by doing the following:

auto result = histogram->Fit(f1,"S L"); 
double chi2 = 2 * result->MinFcnValue(); 

Lorenzo

Dear Lorenzo,
many thanks.

Indeed the number I obtain with your suggestion matches the formula on the paper.
So the question now is: which number shall I sue to make goodness of fit test?
this one double chi2 = 2 * result->MinFcnValue();
or this one myFcn->GetChisquare();
(where myFcn is the function I use to perform the fit)

Either case, which number of degrees of freedom shall I use?

Many thanks again.

  • Mauro.

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