MINUI: Warnings


I have a log likelihood function and I am using ROOT::Minuit2 to minimize it with 7 free parameters.

The fit sometime works fine and get the expected value close to what I expect.

But sometime I see warnings that MINUIT did not converged successfully but the fit values I get from the fit are close to the expected one!!!

(I checked the number of calls did not get exhausted in such cases)

Just wondering what one should do in such a case?

Thanks a lot.

With best regards,

in general if it is just a warning it is fine, if then Minuit converges correctly, i.e. no convergence error is reported. Otherwise, which message do you get ? I would need to see your output log messages,



Below is one such message i get.

WARNING: Minuit did not converge.

of function calls: 350

minimum function Value: 2168.164019826
minimum edm: 82318.7008413
minimum internal state vector: LAVector parameters:

minimum internal covariance matrix: LASymMatrix parameters:
2.1166275e-06 9.2816132e-09 9.8148717e-08 -1.7985469e-06 1.2030582e-10 -8.6259458e-10 4.9981075e-10
9.2816132e-09 2.1235001e-06 5.7783567e-06 1.7399463e-05 1.8357158e-09 -1.3121345e-08 -2.2126963e-09
9.8148717e-08 5.7783567e-06 0.047132202 -0.0014921387 1.1966251e-07 -1.0002469e-06 -8.9992701e-08
-1.7985469e-06 1.7399463e-05 -0.0014921387 0.022576551 -1.3225525e-07 6.0941906e-07 3.2684086e-07
1.2030582e-10 1.8357158e-09 1.1966251e-07 -1.3225525e-07 6.0248222e-08 -3.9292878e-10 9.3318676e-11
-8.6259458e-10 -1.3121345e-08 -1.0002469e-06 6.0941906e-07 -3.9292878e-10 5.7114032e-08 -8.6359742e-10
4.9981075e-10 -2.2126963e-09 -8.9992701e-08 3.2684086e-07 9.3318676e-11 -8.6359742e-10 6.3029462e-07

ext. || Name || type || Value || Error +/-

0 || X0 || free || 0.03378230502543 ||0.001454863383122
1 || Y0 || free || -0.004013975695308 ||0.00145722342883
2 || Z0 || free || 1.053844736895 ||0.2170995214627
3 || sigmaZ || free || 6.110343908389 ||0.1502549529269
4 || dxdz || free || 8.231694911911e-05 ||0.0002454551322734
5 || dydz || free || -0.0003159857221893 ||0.000238985421863
6 ||BeamWidthX || free || 0.02873619731433 ||0.0007939109645742

WARNING: FunctionMinimum is invalid.

with best regards,


yes the minimum is not valid (you have a large edm value = 82318.7 ), so
you can’t trust the result.
Did you have any other message before to know why the minimization stopped ?

No I did not got any other message…

Also these fitted values are close to what I was expecting!!!

Any suggestion how to get the right minima???

with best regards,

I suspect you got stack in settle point, or due to a problem in your function evaluation, in a region where the function does not change its value, and this point is not the minimum.
I will check carefully your objective function evaluation and look at all the function value during the iteration process.
Again, I would need the full debug information for helping you. A program reproducing this will help



Thanks for you help.

Looking at the MINUIT manual , I suspect the same as you pointed out.

I run this program in CMSSW framework, the simulation and reconstruction package for CMS experiment and integrated with some other codes.

So please let me know what is the best way I can provide you this program.
If you just want to take a look of the program I can keep the relevant file it in my public area.
I can also provide you the function values for the iterations for such a case.

Please let me know.

(Just thinking if any kind of discontinuity in the function could leads to such situation???)

with best regards,

Please find the attached file where I have printed the the function value and result after minimization.

The “Fcn” here is -2 * SUM (ln (f)). And f is the product of two Gaussian functions.

With best regards,

Sorry, forgot to attached the file so I kept it here:


With best regards,

Thanks for the file. The function seems oscillating around the minimum, better value were found before. I think this is due to the problem in the derivative calculation due to discontinuities in the function.
If you can keep the function continous there is no much more we can do.

I would try to run maybe Simplex or another minimizer like the simulated annealing (it is provided by mathmore) to see if better minimum values are found. They do not rely on the derivative calculations to find the minimum.

Best Regards



How one can keep the function continuous???

I have prepared a small script to produce the same result for the function I am using. Although I could not able to check it because I am not able to provide the function correctly to MIGRAD and also it complains about a missing symbol!

You can have a look at here:


you have to do ./RUN_Code.csh to run it.

I will highly appreciate if you could look into this small script. I have also put a file “log_problem” which is from running my original code in CMSSW and gives the debug info. for invalid minimum.

With best regards,

I cannot access the link you posted.

I have also one another questions, which version of Minuit2 are you using, the one distributed with ROOT ? Which version number ?