How to get error on point and integral calculated with TF1

Hi! I would need to calculate the integral and individual points through a TF1. I would need to provide the error regarding the Integral and the individual points. I saw that there is a work aroung using the confidence levels at least for the individual points. However, I would prefer something more “straight” forware. Any suggestion how to do this? If not, maybe it would be useful to implement such error calculation in ROOT?

Bets regards


Can you please elaborate more on what you would like to do exactly ? It is not very clear to me…

Suppose you have a function y = f (x | p) where p is a vector of parameters and you have a covariance matrix describing the p uncertainties.
Do you want to compute the uncertainty on the integral of f and the error on the y values ?


Hi! No I have no covariance matrix. I am taken the parameters from a power law fit from a paper. [0] *powe(x/1000,[1]). In order to plot the linee I use TF1 defining defining [0] and [1] and their errors. Lets say that the fit is valued within the range from 200 to 10000 but I would like to calculate the integral above 300 GeV, I can call TF1::Integral(300,10000) and this would give me the integral. However, I would need to know the statistical error on this value, knowing the errors of [0] and [1]. Similar to this, I would need to know the value at 300 GeV. I do this calling TF1:Evaluta(300). But again, I would also need to know the error of this value. Of course you can to this manually calclating the derivatives with respect to [0] and [1] and then calculating performing simple error propagation, but I was hoping to find a way to get these balues directly from ROOT since I define the formula, the parameters and their errors.


Any news on my “problem”?
Best regards


You should retrieve the covariance matrix from your fit and then pass it to the TF1::IntegralError procedure.
If you cannot get the covariance matrix at all, try: Error on Integral of function not Resulting From Fit

BTW. Your function’s formula seems to be quite simple so, if you do not have any information about the covariance matrix, I think you can calculate both the integral and any errors analytically.