Hello root experts. I have a question about the difference in the stored error values for a RooRealVar vs what is printed on the terminal when the minimization is taking place.
I am using RooFit to make a composite signal + background fit to data. The fit status seems to converge, and the covariance matrix status seems good. However, I notice a difference in the uncertainty values that are printed out next to the terminal’s output for a given fit parameter compared to the value that is stored and able to be accessed by FitParam.getError(). This isn’t a large difference, for example an error next to a parameter in the terminal output is 0.8, and the error saved with the variable is 0.9. This discrepancy also exists if I instead of use FitParam.getError(), do:
I notice this difference when I am minimizing with Minuit2, but I don’t notice this when I minimize with Minuit. I have tried to look through some of the previous forum discussions but haven’t seen this topic come up. Is this a known issue (or is it really an issue?). What could be the cause of this discrepancy?
Thank you! Has there been any update on this topic? I’m still curious to the answer, as this discrepancy does not seem a large one, but is notable, and I’m not sure what the cause would be.
I could imagine that the errors you are seeing in the output are from a different stage of the fit. For example, depending on what kind of algorithms you run, you have three errors:
First you see the error estimate from migrad, which is not very accurate
Then you have the HESSE matrix, which takes the second derivative in the minimum to estimate gaussian errors. This, however, holds only when you errors are actually Gaussian. They should be different from the MIGRAD errors.
And finally, you can have MINOS errors, where the likelihood is scanned (which is an expensive operation). MINOS errors are asymmetric, so you wouldn’t see them correctly when you call getError(). If you ran MINOS, you should get the errors using getAsymErrror
If you want to see the above in action, you can have a look at the output of this example:
You will see that after MIGRAD+HESSE, we have e.g.
This difference is to be expected if you have errors that are not Gaussian. If that’s not the origin of the difference you are seeing, you might have to post the output and maybe the code that you ran for us to investigate in more detail.