ROOT::Math::Minimizer failed minimisation

Hi,
I am trying to minimize a three dimensional function, coming from a complicated function which i wrote. Basically the function takes as input three parabola parameters (a,b,c) and give as an output a particular chi squares which depends on a,b,c through the distances of many points from the parabola. Even though is it may seem so, this is something very different from a simple pol2 fit.
To do so, I am using `ROOT::Math::Minimizer.
I am attaching extracts of the code showing the function to be minimised and the minimizer function:
func_to_minimize.cpp (4.6 KB)
minimizer.cpp (2.6 KB)

My suspect is that, since the function is somewhat obscure (in the sense that I don’t see exactly what happens between the input and the output), it could have continuity issues; the fit often fails to find a posdef hessian matrix.
Moreover, the result of the function varies very little from the start ot the end of the minimisation, as you can see in chis.txt (1.3 KB).

Below i am posting a minuit log that often appears when i rn my code.
In particular:

  1. the step size is put to zero (what does that mean?)
  2. the correlation matrix is fine, in the sense that correlations do not exceed 25% or so

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 a           -1.35756e-01  1.00000e-04   -1.49332e-01 -1.22181e-01
     2 b           -4.29053e-01  1.00000e-04   -4.71958e-01 -3.86147e-01
     3 c            3.29822e-02  1.00000e-04    2.96840e-02  3.62804e-02
 **********
 **  525 **SET ERR           1
 **********
 **********
 **  526 **SET PRINT           0
 **********
 **********
 **  527 **SET STR           1
 **********
 **********
 **  528 **MIGRAD       1e+09       0.001
 **********
 MINUIT WARNING IN MIGRAD  
 ============== Negative diagonal element 3 in Error Matrix
 MINUIT WARNING IN MIGRAD  
 ============== 1.00004 added to diagonal of error matrix
 EIGENVALUES OF SECOND-DERIVATIVE MATRIX:
        -8.9317e-01  1.0002e+00  2.8929e+00
 MINUIT WARNING IN HESSE   
 ============== MATRIX FORCED POS-DEF BY ADDING 0.896066 TO DIAGONAL.
 MIGRAD TERMINATED WITHOUT CONVERGENCE.
 FCN=147.959 FROM MIGRAD    STATUS=FAILED        134 CALLS         135 TOTAL
                     EDM=0.293801    STRATEGY= 1      ERR MATRIX NOT POS-DEF
  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE 
   1  a           -1.35924e-01   1.25019e-06  -0.00000e+00   1.55942e+00
   2  b           -4.29188e-01   3.26929e-07  -0.00000e+00   9.71282e+01
   3  c            3.26921e-02   2.89331e-07  -0.00000e+00   2.43837e+02

Am I trying to do something that is not “allowed”, or am I using Minimizer in the wrong way? Or the problem lies in the function itself? Any suggestion is welcome.
Also tell me if additional code is needed to better understand the problem
Ciao and thanks in advance,
Lorenzo

I guess @moneta can help.

Hi,
If the objective function to minimize is having discontinuities or is noisy, in the sense that when asking for the same x values can return different results, then Minuit will have certainly problems to find the minimum. You can for example make a plot of the function ( a scan) versus one of the parameter to see how it behaves.
I can try to have look into this, but I would need to have your full running code. Otherwise I can say you more if I see the full log of the minimisation. I would trying using Minuit2 which also produced more understandable messages.

Best regards

Lorenzo

Hi,
In the previous days I managed to slightly modify the function, in order to improve its continuity and avoid too much correlation between parameters.
Now the fits converges (line 95 of attached file) and gives acceptable values with reasonable errors, the Status() function returns 0 or 1.
When I try to compute Minos error, instead, it fails; I am posting the complete log of Minuit, with maximum printlevel.
I have now three questions:

  1. How can I retrieve the errors extimated on parameters shown in lines ~100 and what are their meaning in this case, exactly? I suppose thy are not computed with Minos method.
  2. I don’t have Minuit2. Do you think it is worth to be installed to solve this specific problem?
  3. In general, are there any hints in the Minuit log that should warn me that the problem is the continuity/differentiability of the function? I am focusing on that, but I am not sure if I should look elsewhere to solve this problem.

Minuit_log.txt (30.4 KB)

Hi,
From the log seems to me that the result is fine. Minos seems to fail because the first parameter is both at the limit in both lower and upper side. Are you setting correct limits on that parameter ?
Also from the log it looks like you are running Minos only for the first parameter.
Minuit2 is recommended to be used instead of the older Minuit. It is part of the ROOT distribution, or if building from source old release versions, you need to build ROOT with -Dminuit2=On

Best regards

Lorenzo

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