TGraphErrors Fit Uncertainty

Hi everyone,

I am running into a problem when fitting in TGraphErrors.

My understanding from the TGraph:Fit document is that TGraph simply uses the un-weighted least-square fit, no uncertainty is considered at all. TGraphErrors uses the uncertainties as the weights, but if option “W” is provided, it will ignore the uncertainties and use the un-weighted least-square fit as well.

I tried both TGraph and TGraphErrors fitting in both ways, the FitResults are the same and the fitting looks great. However, if I include uncertainties in TGraphErrors, the fit results are different, and in my case, the fitting is much worse.

I am curious about:

  1. How TGraph and TGraphErrors determine the un-weighted least square fit uncertainty. (If it’s a histogram then it is the sqrt of y(i), but this is not the case in TGraph?)
  2. How to force the fitting to be better when uncertainties are considered? I tried setting bounds on the parameters but no luck so far.


ROOT Version:6.26.10

A few plots are below.


Thanks! I looked through that document but failed to find how exactly it assign the un-weighted uncertainty at each data point.

However, the fitting issue is solved by removing a few data points on the far right. I am all good now.

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