I plotted the data in a TGraphError, then I used a linear fit… now I would like obtain the error function respect to the real points.
I know that I could do an iteration error=y-y’ (where y= real points, and y’= expected points) but I hope that there is a more faster function, also because the fit is done only in a specific range of data… can you help me?
I am not sure I have understood exactly your question. What would you like to obtain, the error on the function value for each data point resulting from the fit ?
For this you can use the function FitResult::GetCOnfidenceIntervasl
Otherwise, there is no yet an automatic function to get this in ROOT. It is however trivial to loop on the data points and computing the difference with the function values.
HI Lorenzo,
Yes what I want is the mean residual between the real points and the expected points from the function fit… but I don’t want plot each residual values, I want only the mean value.