Hi everyone,

I am trying to use minuit to make a likelihood fit and I’m struggling to find a positive defined error matrix (my implementation was originally based in this example https ://root.cern/doc/v610/Ifit_8C_source.html). I have a sample of 15 histograms with two contributions, signal and background, each one of them described by a convolution of a gaussian and a landau functions (I’m using the definition here https ://root.cern/doc/master/langaus_8C.html). The different parameters of each landau-gaus are described by parametric functions along the histograms. In the case of the background is quite simple since the variation of the parameters is soft and it can be described linearly. However, in the case of the signal, parameters vary exponentially at some point, so its description can’t be linear anymore and has to be exponential/rational. The fit converges and if one looks at residuals it performs well, however minuit is always getting a error matrix not positive defined.

I have read different threads in the forum suggesting to try different things:

- Originally the parametric functions I was using where handmade, but now I’m using orthogonal functions. I’ve been able to decrease the correlation between parameters, however it is still large.
- I have tried to scale parameters so they are of the same order of magnitude.
- I have tried to play with the step, fixing and releasing some of the parameters, different minuit strategies, etc.

So far, I haven’t been able to find a convergence without the error matrix problem. I’m posting below the outcome of minuit (with strategy 1, so it is shorter). I would appreciate any suggestion to solve this issue.

```
**********
** 1 **SET ERR 0.5
**********
PARAMETER DEFINITIONS:
NO. NAME VALUE STEP SIZE LIMITS
1 slw A 3.19419e+00 1.00000e-01 no limits
2 slw A -7.35809e+00 1.00000e-01 no limits
3 slw A 6.09946e+00 1.00000e-01 no limits
4 smpv A -6.57937e+01 1.00000e-01 no limits
5 smpv B 2.48719e+02 1.00000e-01 no limits
6 smpv C -2.82921e+02 1.00000e-01 no limits
7 smpv D 1.10803e+02 1.00000e-01 no limits
8 sgw A 3.02901e-01 1.00000e-01 no limits
9 sgw B 1.25424e+00 1.00000e-01 no limits
10 sgw C 4.01470e-01 1.00000e-01 no limits
11 snorm 3.96431e-01 1.00000e-01 no limits
12 blw A -1.10608e+00 1.00000e-01 no limits
13 blw B 6.99002e-01 1.00000e-01 no limits
14 bmpv A 2.12531e+00 1.00000e-01 no limits
15 bmpv B 1.22481e-01 1.00000e-01 no limits
16 bmpv C -1.53774e+00 1.00000e-01 no limits
17 bgw 1.53570e-02 1.00000e-01 no limits
18 bnorm 8.48840e-02 1.00000e-01 no limits
**********
** 2 **MIGRAD 5e+05 1
**********
FIRST CALL TO USER FUNCTION AT NEW START POINT, WITH IFLAG=4.
START MIGRAD MINIMIZATION. STRATEGY 1. CONVERGENCE WHEN EDM .LT. 1.00e-03
FCN=2554.45 FROM MIGRAD STATUS=INITIATE 114 CALLS 115 TOTAL
EDM= unknown STRATEGY= 1 NO ERROR MATRIX
EXT PARAMETER CURRENT GUESS STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 slw A 3.19419e+00 1.00000e-01 0.00000e+00 -2.78836e+03
2 slw A -7.35809e+00 1.00000e-01 0.00000e+00 -5.21544e+02
3 slw A 6.09946e+00 1.00000e-01 0.00000e+00 8.21955e+02
4 smpv A -6.57937e+01 1.00000e-01 0.00000e+00 -8.74304e+02
5 smpv B 2.48719e+02 1.00000e-01 0.00000e+00 -1.08712e+02
6 smpv C -2.82921e+02 1.00000e-01 0.00000e+00 3.21091e+02
7 smpv D 1.10803e+02 1.00000e-01 0.00000e+00 5.13439e+02
8 sgw A 3.02901e-01 1.00000e-01 0.00000e+00 -3.53344e+02
9 sgw B 1.25424e+00 1.00000e-01 0.00000e+00 -1.31037e+02
10 sgw C 4.01470e-01 1.00000e-01 0.00000e+00 2.81988e+01
11 snorm 3.96431e-01 1.00000e-01 0.00000e+00 5.95406e+02
12 blw A -1.10608e+00 1.00000e-01 0.00000e+00 -6.62292e+02
13 blw B 6.99002e-01 1.00000e-01 0.00000e+00 -1.33236e+03
14 bmpv A 2.12531e+00 1.00000e-01 0.00000e+00 -4.09754e+02
15 bmpv B 1.22481e-01 1.00000e-01 0.00000e+00 7.81495e+02
16 bmpv C -1.53774e+00 1.00000e-01 0.00000e+00 -2.74423e+00
17 bgw 9.01066e-02 1.00000e-01 7.47496e-02 3.30492e+00
18 bnorm 8.48840e-02 1.00000e-01 0.00000e+00 1.32578e+03
ERR DEF= 0.5
MIGRAD MINIMIZATION HAS CONVERGED.
MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
EIGENVALUES OF SECOND-DERIVATIVE MATRIX:
-1.0114e-02 -8.4229e-03 -3.3778e-03 1.5594e-03 1.0084e-02 2.7456e-02 4.0005e-02 1.4564e-01 2.7067e-01 3.7230e-01 5.4190e-01 5.8787e-01 6.9819e-01 1.0007e+00 1.0965e+00 3.5637e+00 4.2473e+00 5.4181e+00
MINUIT WARNING IN HESSE
============== MATRIX FORCED POS-DEF BY ADDING 0.015532 TO DIAGONAL.
FCN=2502.23 FROM HESSE STATUS=NOT POSDEF 260 CALLS 1918 TOTAL
EDM=0.00109231 STRATEGY= 1 ERR MATRIX NOT POS-DEF
EXT PARAMETER APPROXIMATE STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 slw A 2.99269e+00 9.13154e-03 4.16811e-05 1.11232e+00
2 slw A -6.85769e+00 3.15355e-02 2.94437e-04 -5.08921e-02
3 slw A 5.71477e+00 2.07845e-02 1.12780e-04 4.24168e-01
4 smpv A -6.56473e+01 2.37630e-02 9.77130e-05 3.78658e-01
5 smpv B 2.48528e+02 8.32935e-02 7.81362e-04 2.11647e-02
6 smpv C -2.82981e+02 5.61563e-02 2.51471e-04 2.70283e-01
7 smpv D 1.11044e+02 4.12117e-02 1.63193e-04 4.33484e-02
8 sgw A -3.93001e-01 2.25369e-02 9.51033e-05 -5.66321e-01
9 sgw B 2.96129e+00 6.46402e-02 7.38651e-04 -2.53038e-02
10 sgw C -9.13939e-01 4.97529e-02 2.48670e-04 -1.98799e-01
11 snorm 3.87073e-01 3.26617e-03 9.50566e-05 -6.66382e-02
12 blw A -1.68016e+00 4.69172e-02 2.79756e-04 7.09820e-02
13 blw B 9.92256e-01 2.23126e-02 1.36271e-04 2.09217e-01
14 bmpv A 2.17053e+00 4.56398e-02 3.24195e-04 2.02575e-02
15 bmpv B 7.48913e-02 1.04711e-02 1.83362e-04 -6.94174e-01
16 bmpv C 1.08541e+00 3.01501e+00 2.60247e-02 -3.13065e-03
17 bgw 7.54284e-06 3.96259e-02 1.36757e-03 5.63713e-03
18 bnorm 9.14224e-02 2.74266e-03 5.57469e-05 -3.20056e-01
ERR DEF= 0.5
MIGRAD MINIMIZATION HAS CONVERGED.
MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
EIGENVALUES OF SECOND-DERIVATIVE MATRIX:
-3.1067e-03 2.7950e-03 6.4404e-03 1.2508e-02 1.8433e-02 3.0416e-02 5.6599e-02 1.6289e-01 2.7964e-01 3.5901e-01 5.2361e-01 5.8476e-01 7.0127e-01 1.0001e+00 1.0948e+00 3.5480e+00 4.2428e+00 5.3791e+00
MINUIT WARNING IN HESSE
============== MATRIX FORCED POS-DEF BY ADDING 0.008486 TO DIAGONAL.
FCN=2502.07 FROM MIGRAD STATUS=CONVERGED 2843 CALLS 2844 TOTAL
EDM=0.000259052 STRATEGY= 1 ERR MATRIX NOT POS-DEF
EXT PARAMETER APPROXIMATE STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 slw A 2.88379e+00 9.54753e-03 4.14949e-05 4.10736e-01
2 slw A -6.60386e+00 3.13884e-02 2.96285e-04 5.42212e-02
3 slw A 5.50347e+00 1.86586e-02 1.12455e-04 2.77214e-01
4 smpv A -6.57042e+01 1.99237e-02 9.79021e-05 5.16851e-01
5 smpv B 2.48874e+02 6.42240e-02 7.82631e-04 -5.35246e-02
6 smpv C -2.83516e+02 4.51017e-02 2.50837e-04 -2.29009e-02
7 smpv D 1.11356e+02 4.08895e-02 1.63294e-04 -1.00032e-01
8 sgw A -1.80894e-01 1.94104e-02 9.56872e-05 -1.11843e-01
9 sgw B 2.46642e+00 6.64350e-02 7.31068e-04 -2.79255e-02
10 sgw C -5.02457e-01 3.84029e-02 2.49724e-04 1.17161e-01
11 snorm 3.87064e-01 3.25217e-03 9.50211e-05 3.28914e-01
12 blw A -1.66884e+00 4.41173e-02 2.80156e-04 7.88147e-02
13 blw B 9.86811e-01 2.15349e-02 1.36257e-04 -1.32711e-01
14 bmpv A 2.17013e+00 5.20274e-02 3.25475e-04 8.13525e-02
15 bmpv B 7.48940e-02 1.15706e-02 1.84907e-04 -8.13597e-01
16 bmpv C 1.09455e+00 3.38409e+00 2.62114e-02 -1.97682e-04
17 bgw -2.59995e-06 3.92780e-02 1.36313e-03 -1.12753e-03
18 bnorm 9.12969e-02 2.68852e-03 5.56026e-05 9.40593e-01
ERR DEF= 0.5
```