# How to determine if a parameter is near the limit

I’m trying to determine in a program whether a parameter is near the limit to warn the user about the fact that the error estimates might be unreliable. I use Minuit2 as a minimizer (via `ROOT::Math::MinimizerOptions::SetDefaultMinimizer("Minuit2", "Combination");`).

How can I check after a call to TH1::Fit whether any of the parameters is near the limit? Minuit used to output the `** at limit **` warning if a parameter was at the limit (unless the “q” option is used), but Minuit2 doesn’t do that anymore. Is there an easier way than to just loop through all parameters and comparing the value to the limits?

I see that in a case where the error estimation fails the reported error on that parameter and the square root of that parameters diagonal element of covariance matrix don’t match. Is that a reliable test or is that just a something that can happen if the parameter is near its limits?

I tried checking the status of the fit result or if it is valid, but the status is always zero and the fit result claims to be valid (which I guess it is, since the parameter value is good, just not the parameters error estimate). I also tried checking if the parameter has a minos error which is not the case, but since I’m not using minos that’s not surprising.

Hi,
If you are fitting with option “V”, you should have in Minuit2 also a message indicating that the specific parameter is “at upper limit”.
You are probably right, we should add this message also in the printed result, visible also when not using the verbose option and add a flag to indicate that the value in the covariance matrix is not reliable.
In this case one should not use the parabolic approximation for errors but Minos, to determine correctly the lower (or upper) error estimate.

Cheers

Lorenzo

I didn’t know that I could use Minos in these cases, that is good to know thanks!

So in a program or script, there is no way to know if the parameter is at it’s limit unless I try and parse the output (using the “v” option)?

Or is the test of comparing the reported error of the parameter with the square root of the corresponding diagonal entry of the covariance matrix a good test?

Yes, Minos in this case should always report the correct error for the unlimited side…

I think in a program you can check if the parameter +/- error is larger/smaller than limit value. If it is the case then your parameter is close to the limit and I think the error estimate using the Hessian is not anymore reliable, and I would recommend using Minos in that case to estimate a better interval. However, when bounds are present better to use other methods to estimate the confidence intervals, and such tool exists for example in RooStats (see asymptotic estimation of upper limits).

I have checked that the message printed by Minuit is happening only when the parameter value is very close to the limit (within something like 10^-6). In that case you have always a big difference between estimated error and sqrt(covariance matrix element).
At the limit is expected that the corresponding covariance matrix element will be close to zero due to the vanishing gradient of the transformation.

Cheers

Lorenzo

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