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:

- the step size is put to zero (what does that mean?)
- 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