Does Pearson chi square fit use expected error or observed error in TH1::Fit()

Hi all,

I tried to fit two linear histograms with one data point shifted up. (see attached)
The data point is assigned with a very large error by Setbinerror in one of the histogram (linear_testfit_large_unc_P.pdf), while the data point in the other histogram (linear_testfit_norm_unc_P.pdf) just obtain the normal error which is the square root of the bin content.

I fitted both histograms with Pearson chi square method by the option “P” in TH1::Fit().
As described in the manual 7.1.1,Pearson chi-square method is using expected errors instead of the observed one.

I would expect the two histograms give the same fitted result since the bins contents are the same for the two histograms. However, the fitted results are different as shown. This means the assigned errors do affect the fitting. It looks to me that the Pearson chi square method is using observed error instead of the expected one. How exactly does Pearson chi square fit work with the errors?

Thank you all in advance!
linear_testfit_norm_unc_P.pdf (15.0 KB)
linear_testfit_large_unc_P.pdf (15.0 KB)

Welcome to the ROOT forum

I guess @moneta can help

Hi,
How did you fit the histogram? It is possible you pass a linear function and in that case by default the linear fitter is used and this has the precedence to the option “P”. You can try to add also the option “F” to force a non-linear fit in case the function you are using is a polynomial (e.g. pol1)

Lorenzo