Incorrect estimation of error on slope parameters while fitting TGraph

I am fitting a TGraph with an exponential function to analyze the slope parameter, which is crucial for my study. However, I have observed discrepancies in the error values of the slope parameter when using different fitting methods.

My data consists of points (x, y) with associated error bars (yerr). I am fitting three separate graphs, each correspond to some physical quantity measured across 3 years of time (2016-2018 year). Surprisingly, the error bars on the slope parameter are not consistent across these fits. For instance, the first 2016 dataset has a similar statistical profile to the 2017 dataset, but the 2017 dataset has twice the number of bins. Thus, I expect the error on the slope for 2017 to be about half of that for 2016. However, when using the ROOT Fit function, the error values differ by an order of magnitude. Conversely, when fitting the data using the curve_fit function in Python, the error bars appear as expected.

I have attached both programs used for fitting my data with TGraph and the curve_fit function. I am looking for a reliable method to derive the errors on my fit parameters when using TGraph.

I also attach the fits I obtain with root and python for all 3 years.

Additionally, for the specific region I am fitting, the exponential function behaves almost like a straight line.

I appreciate any insights or suggestions on resolving this issue. Thank you!
I can not attach links to the post, as new users. Let me know if you need more information.

Hi Neha,

Thanks for the post and welcome to the ROOT community.
I do not see any file attached.

From what you say, it’s hard to guess. The argument of having smaller errors on fit parameters with more bins does not really hold, right? It’s not the number of points in a fit that influence the uncertainty on the parameters estimates.

I would perhaps check with someone in your team about the physics behind your fits, and then perhaps re-post if a ROOT issue is identified.


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