Chi2 fit does not work?


When I fit my data (the script and the resulted plot are attached) I observe some strange results (inconsistencies) between ML and Chi2 fits.

The figure “fit.eps” was obtained by running the script with

$ python --events=1000

It shows good ML-fit results (red curve/stats) and that the chi2-fit (blue curve/stats) failed.
The number of generated events really does not matter, the chi2 fit never converges. Why? What is wrong?

The Chi2-fit was done like this:

    chi2 = ROOT.RooChi2Var("chi2","chi2",fit_func,data,ROOT.RooFit.DataError(ROOT.RooAbsData.SumW2))
    m = ROOT.RooMinuit(chi2)

ROOT version 5.26/00 with RooFit 3.12.

Thanks a lot in advance,
fit.pdf (17.9 KB) (9.63 KB)

Try to set the upper range in the Mass to around 200 for the Chi2 fits. The RooFit Chi2 fit includes all the empty bins in the fit and this most probably distorts the fit.


No, this is not the case. I tried to increase the number of events, reduced number of bins (–bins=20), changed the background shape (option --bkg=0 for example). Sometimes (but very seldom) fit works (still producing very questionable results, especially on parameter errors) but very often it does not.

On the figure “fig2.pdf” you will see the fit result of a distribution, where all bins (10) are filled. Again, no problem with ML fit (binned and unbinned), chi2 fit did not work…

$ python --events=10000 --bins=10 --fit-ML-b=1 --bkg=-2e-3

fit2.pdf (10.1 KB)

No comments? No suggestions?