Value of tolerance (avoiding edm above max)

Hello guys,

We are using Minuit2 in a fitting routine. After several months of struggle (to say the least), we managed to have it converged properly using Migrad and setting a tolerance of 90 (not 0.1). It resulted in a value of edm of 0.05 (<0.09=90 x 0.001 x 1). Interesting enough, when it fails (edm above max) the Fmin value is the same as for the edm of 0.05.

Questions:

  • is there something wrong by setting the tolerance to 90?
  • is there some way to adjust the tolerance pre-facto so that it converges?

Thanking you in advance,

ThierryA

Hi @tappourc ,
and welcome to the ROOT forum!
I believe @moneta will be able to help, let’s ping him.

Cheers,
Enrico

Hi,
Using 90 of tolerance is quite large , but maybe is sufficient for your problem.
The most likely cause that you are struggling to have your minimization to converge is because your implementation of the objective function you are passing to Minuit is not precise enough. If you can improve it, by re-implementing the function or re-parameterize it it will be helpful.
Unfortunately one cannot adjust the tolerance a-priori for this. You would need to experiment. I think for the fitting in ROOT we require a tolerance smaller than 1, which corresponds an edm smaller than 10^-3 which is much smaller than the statistical error of the fit (DeltaL < 0.5 or 1).

Cheers

Lorenzo

Thank you for you reply…and sorry for my belated response. It seems that I never got the notification.

I managed to have some progress on it. I am minimizing a log(likelihood) with 184 parameters. My understanding of the edm is that it is roughy equal to N_param x (relative error)^2/2, so a tolerance of say 90 would give an edm < 0.09, providing a relative error of 0.03 (a 1/30th of a sigma) which is enough for our application.

The other question I have is the following, I set a tol of 100 and I get such a run, in the end I get an edm with is below the max, and an edm from the Hessian identical…stil the status is 0 (failed)…why is that?
See below.

Thanking you in advance,

ThierryA

MnSeedGenerator: for initial parameters FCN = -524908
MnSeedGenerator: Initial state: - FCN = -524908.4447738 Edm = 88.571 NCalls = 723
MnSeedGenerator: Negative G2 found - new state: - FCN = -524908.4447738 Edm = 88.571 NCalls = 723
VariableMetric: start iterating until Edm is < 0.1
VariableMetric: Initial state - FCN = -524908.4447738 Edm = 88.571 NCalls = 723
VariableMetric: Iteration # 1 - FCN = -524955.6554319 Edm = 4.8067 NCalls = 1205
VariableMetric: Iteration # 2 - FCN = -524962.1475929 Edm = 3.65806 NCalls = 1583
VariableMetric: Iteration # 3 - FCN = -524968.6782288 Edm = 4.36685 NCalls = 1970
VariableMetric: Iteration # 4 - FCN = -524976.5991184 Edm = 3.63991 NCalls = 2353
VariableMetric: Iteration # 5 - FCN = -524981.2355117 Edm = 5.44596 NCalls = 2740
VariableMetric: Iteration # 6 - FCN = -524986.0814052 Edm = 3.95615 NCalls = 3125
VariableMetric: Iteration # 7 - FCN = -524988.196269 Edm = 4.4722 NCalls = 3504
VariableMetric: Iteration # 8 - FCN = -524992.9521155 Edm = 3.9607 NCalls = 3886
VariableMetric: Iteration # 9 - FCN = -524995.9784866 Edm = 2.08827 NCalls = 4260
VariableMetric: Iteration # 10 - FCN = -524997.885652 Edm = 1.30287 NCalls = 4634
VariableMetric: Iteration # 11 - FCN = -524998.9733973 Edm = 0.685435 NCalls = 5017
VariableMetric: Iteration # 12 - FCN = -524999.7471109 Edm = 1.05336 NCalls = 5394
VariableMetric: Iteration # 13 - FCN = -525001.0231184 Edm = 1.18649 NCalls = 5773
VariableMetric: Iteration # 14 - FCN = -525003.833539 Edm = 1.52717 NCalls = 6151
VariableMetric: Iteration # 15 - FCN = -525005.2488222 Edm = 1.17632 NCalls = 6526
VariableMetric: Iteration # 16 - FCN = -525006.1290874 Edm = 0.404324 NCalls = 6904
VariableMetric: Iteration # 17 - FCN = -525006.3830275 Edm = 0.216217 NCalls = 7279
VariableMetric: Iteration # 18 - FCN = -525006.6204574 Edm = 0.188764 NCalls = 7662
VariableMetric: Iteration # 19 - FCN = -525006.8607616 Edm = 0.330696 NCalls = 8042
VariableMetric: Iteration # 20 - FCN = -525007.2568275 Edm = 0.243056 NCalls = 8423
VariableMetric: Iteration # 21 - FCN = -525007.4680025 Edm = 0.0883097 NCalls = 8803
VariableMetric: Iteration # 22 - FCN = -525007.5650159 Edm = 0.0378167 NCalls = 9176
VariableMetric: After Hessian - FCN = -525007.5650159 Edm = 0.0378167 NCalls = 9187
status MMinzerMinimize : 0

Hi,
Looking at the log of your minimization, everything looks good to me. Status=0 means that it converges.

Cheers

Lorenzo

Hi Lorenzo,
Ok this is what I suspected…so when it is at 1 it means that the matrix (Hessian) was made positive definite?

I think the pb is then in the rest of the code not in Minuit2…

Cheers,

ThierryA

Lorenzo,

Another question, what is the relation between min.IsValid() and “status MMinzerMinimize : 0”?

Is it the same?

Thanks

ThierryA

Hi,
If status=0 or =1 is still valid, but 2,3,4,5 are instead invalid minimum.
The case of status=1 is when the covariance matrix was made positive defined during minimization.
If you have further questions, please let me know
Cheers

Lorenzo

Thanks Lorenzo.
This is what I understood from the documentation. Now what would be the value of min.IsValid() for the status case you mentioned?

Best

ThierryA

Here are the various values of status and the isValid() flag:

  • status = 0 : min.IsValid()=true
  • status = 1 : min.IsValid()=true : Covavriance matrix was made pos defined
  • status = 2 : min.IsValid()=false : Invalid Hessian
  • status = 3 : min.IsValid()=false : Edm is above tolerance
  • status = 4 : min.IsValid()=false : Reached function call limit
  • status = 5 : min.IsValid()=false : Covavriance is not positive defined

Ok great you made my day.

Have a good week-end,

ThierryA