I found very strange value of chi2 for a fraction fit.
I was wondering if the chi2 takes into account statisical on both template and data histograms
From the method http://root.cern.ch/root/html/src/TFractionFitter.cxx.html#EZh8dC
it doesn’t seem they are taken into account
can you confirm this?
The chi2 is based on the approximation that asymptotically the likelihood ratio is distributes as a chi2. Since the likelihood contains the statistical uncertainty of the predictions, they will also be part of the chi2.
Maybe you obtain strange result either because the fit is poor or because you have very low statistics and the asymptotic approximation does not work anymore
TH1D* s = (TH1D*)fit->GetMCPrediction(0);
TH1D* b = (TH1D*)fit->GetMCPrediction(1);
adding the histograms correctly normalized for the fraction result (sb is the sum of the histograms s and b)
I obtain:
sb->Chi2Test( data, “WU CHI2/NDF” ) => 0.214535
(given the size of the template errors this last result looks reasonable)
this difference could be maybe explained with bins with low statistics but I would need to see your histograms (data, result, s and b). Could you please attach them in a root file ?