# Minuit, correlation matrix when some parameters are fixed

Dear Root team,

I get the correlation matrix with the following code:

`````` correlation_matrix = new double[number_of_parameters*number_of_parameters];

gMinuit->mnemat (correlation_matrix, number_of_parameters);``````

Consider this example with 3 fixed parameters:

`````` FCN=25.0296 FROM MIGRAD    STATUS=CONVERGED     159 CALLS         160 TOTAL
EDM=1.76359e-10    STRATEGY= 1      ERROR MATRIX ACCURATE
EXT PARAMETER                                   STEP         FIRST
NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE
1  normalisation   5.45620e+00   7.27962e-01   2.65966e-06  -7.78900e-03
2  mean         3.09072e+00     fixed
3  sigma        5.31116e-02     fixed
4  constant     1.39707e+01   6.89228e-01   1.68089e-03   9.08073e-06
5  slope       -2.33399e-11   4.22742e-01   3.24051e-04** at limit **
6  correction   0.00000e+00     fixed

Correlation matrix:
0         1         2         3         4         5
_0__5.30e-01_-1.02e-01__2.22e-10_6.79e-313_3.19e-313_6.01e-154
_1____________4.75e-01__1.94e-08_6.01e-154_3.19e-153_6.79e-313
_2______________________3.95e-11_6.79e-313_3.19e-313__4.91e+25
_3_______________________________6.01e-154_6.06e-153_1.38e-312
_4_________________________________________4.24e-253__1.49e+20
_5___________________________________________________2.06e-312
_0__5.30e-01
_1_-1.02e-01__4.75e-01
_2__2.22e-10__1.94e-08__3.95e-11
_3_5.97e-153_2.06e-312_4.24e-253_6.01e-154
_4_4.24e-253_7.93e+102_2.25e-307_7.06e-313_4.24e-253
_5_4.65e+107_6.79e-313_3.19e-313__1.30e-76_1.44e-312_2.06e-312``````

Firstly, I noticed in the case where some parameters are fixed the correlation matrix is reduced, which is not documented. And not easy to manage.

Moreover, I can only verified by hand “normalisation” and “constant”, but not the last “slope”.

``````> \$e=7.27962e-01 ;sprintf("%.2e", (\$e)**2)
=  5.30e-01

> \$e=0.68922756632699 ;sprintf("%.2e", (\$e)**2)
=  4.75e-01

> \$e=0.422741590148873 ;sprintf("%.2e", (\$e)**2)
=  1.79e-01``````

The matrix seems right until 1, and symetric until 2.

What’s happen?

Hi Fabrice,

The correlation matrix is for the free parameters only !
So indeed a 3 x3 matrix in your case .

Internally, the minimization engine is only aware of free
parameters . One can translate these numbers to the
user index through the TMinuit data member Int_t *fNexofi .

So in your case gMinuit->fNexofi[i] where i = 0,1,2 .

To translate in the other direction use Int_t *fNiofex , which contains
a zero for a fixed parameter and otherwise the internal number .

The slope parameter seems to be stuck at a parameter limit, here
the error calculation/interpretation is different (I believe), see manual .

Eddy