Contours from Math::Minimizer

Hello.
Is this the right way of getting a confidence contour from Math::Minimizer?

[code][…]

minimizer->SetErrorDef(pow(sig, 2.0)); // Error def must be set to sig^2.
double* xs = new double[numPoints];
double* ys = new double[numPoints];
minimizer->Contour(parIndex[0], parIndex[1], numPoints, xs, ys);
TGraph* cp = new TGraph(numPoints, xs, ys);

[…][/code]

Because when I try it with Minuit it tells me that it could not find more than 4 points. Minuit2 says something like:

Info in <Minuit2>: MnMinos could not find Upper Value for Parameter : par = 0 Info in <Minuit2>: VariableMetricBuilder: Tolerance is not sufficient, continue the minimization Info in <Minuit2>: edm = 6.66494e-05 Info in <Minuit2>: required : edmval = 5e-05 Info in <Minuit2>: MnMinos could not find Lower Value for Parameter : par = 0 MnContours is unable to find first two points. Error in <Minuit2>: Minuit2Minimizer::Contour : Invalid result from MnContours Info in <Minuit2>: MnMinos could not find Upper Value for Parameter : par = 0 Info in <Minuit2>: VariableMetricBuilder: Tolerance is not sufficient, continue the minimization Info in <Minuit2>: edm = 0.00142805 Info in <Minuit2>: required : edmval = 0.0008 Info in <Minuit2>: MnMinos could not find Lower Value for Parameter : par = 0 MnContours is unable to find first two points. Error in <Minuit2>: Minuit2Minimizer::Contour : Invalid result from MnContours Info in <Minuit2>: MnMinos could not find Upper Value for Parameter : par = 0 Info in <Minuit2>: MnMinos could not find Lower Value for Parameter : par = 0 MnContours is unable to find first two points. Error in <Minuit2>: Minuit2Minimizer::Contour : Invalid result from MnContours

The fit itself is OK (converged, accurate error matrix, no warnings, nice results).
I should probably also mention that limits are imposed on the parameters.

Thanks.
Petr

Hi,

it looks to me that Minuit has problems to find the contour of the function.
In order to investigate it, I would need to repeat your fit, is it possible to isolate in a single program ?
I am away right now, but I will investigate it when I’ll be back next week

Best Regards

Lorenzo

Hello and thanks for the answer.

I probably discovered the main problem. It has something to do with my previous post. There are regions in the parameter space where the numerical integration involved in the calculations fails. When I try to obtain contours using no limits it fails with the errors above. When I restrict the parameters to the “safe” region only I gen the contours…

As far as I understand from the manual it is generally favourable to avoid using limits, because MINUIT than returns safer error estimates.

One possible solution I see is to perform one fit without limits to obtain numerical results (It converges without errors provided that the initial parameters are close to the minimum. This can be ensured by random search of selected area possibly combined with Simplex etc.) and then perform the same fit, but with restricted parameters from which it should be possible to generate the contours. Does it make any sense for you?

Thanks.
Petr

Hi,

yes, it makes sense. There is no problem to get contours with limited parameters (the error estimation is also good) as far the contour does not cross the limited region.
Adding limits to the parameters increase the non linearity of the problem, to due a non-linear transformation made internally by MINUIT.
This may make the convergence more difficult or slower, but the error estimation is still correct if you are using MINOS.

Best Regards

Lorenzo

Thanks for answer.

So, to sum it up. The MINOS errors are always reliable even if I use constrained parameters. Right?
Then I can minimize directly using parameter limits and get the contours from there…

Petr

[quote=“moneta”]Hi,

yes, it makes sense. There is no problem to get contours with limited parameters (the error estimation is also good) as far the contour does not cross the limited region.
Adding limits to the parameters increase the non linearity of the problem, to due a non-linear transformation made internally by MINUIT.
This may make the convergence more difficult or slower, but the error estimation is still correct if you are using MINOS.

Best Regards

Lorenzo[/quote]

Hi,

The MINOS error are always reliable, even in case of high non-linearity of the functions. The error obtained from HESSE (i.e from the inverse of the hessian matrix) are correct as far as the function can be well approximated by a parabola around the minimum.

Yes, as I said before, you can do this, but in some cases you might observe a slower or more difficult convergence towards the minimum.
For the contour this is fine as far as the contour stays in the good region

Best Regards

Lorenzo

Hi,

I have been trying to do a fitting problem using Minuit2. I am facing some problems. I would be really grateful if you can help me out on this. I have three parameters and I am trying to get their best fit values along with uncertainties.

Also, I am trying to get the contour between the first two parameters. Now, I have just modified the file DemoGaussSim.cxx and the other linked files.

But I am not getting any contours, but this error message :

“Minos Error is not valid.”
“upper/ lower Minos Error is not valid.”

and then :

“Error: MnContours is unable to find first two points.”

I can’t fix the problem and will be really grateful if you can help me out.

Yours sincerely,

Shankha Banerjee.