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
it doesn’t seem they are taken into account
can you confirm this?
I would like to up this topic.
Maybe somebody is aware of 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
Thank you Lorenzo!
I am not sure what could be…
I can only quote some numbers (and not plots) that I obtain with different methods
fit->GetChisquare()/fit->GetNDF() => 8.88866
result->Chi2Test( data, “WU CHI2/NDF” ) => 4.44937
(given TH1F* result = (TH1F*) fit->GetPlot(); )
But if I use the obtained templates
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)
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 ?
see attached file
fracFitHisto.root (6.25 KB)
do you have any follow up on this topic?