Fit Convergence with Status 5

Dear Experts,

I’m trying to minimize a given likelihood and obtained the following results, where the pulls seem reasonable and the uncertainties as well, but the status it gives is 5, meaning the Hessian failed.

Info in : VariableMetricBuilder Stop iterating after 194.74 ms
Warning in : CombinedMinimumBuilder Both migrad and method failed also at 2nd attempt; return simplex Minimum
Warning in : Minuit2Minimizer::Minimize Covar is not pos def
Minuit2Minimizer : Valid minimum - status = 5
FVAL = -898945.671385084046
Edm = 3.88594344258308411e-07
Nfcn = 155
deltaAy = 0.00096811 +/- 0.00245604
deltaAz = -0.000335685 +/- 0.0104327
deltaBz = 9.58189e-05 +/- 0.0202858
deltaBy = 0 (fixed)
kappa = 1 (fixed)

— Parameter Pulls —
deltaAy pull = 0.394175
deltaAz pull = -0.0321764
deltaBz pull = 0.00472344

Could you please explain why this is happening?

Best,

Dear @Mustaphaa ,

Thanks for reaching to the forum, maybe @jonas will be able to give you more insights about the result of your fit.

Cheers,
Vincenzo

Sorry, I got not enough context to help here. What is the mathematical definition of your likelihood? Do you expect it to be parabolic around the minimum? Do you have a a reproducer you can upload here?

My feeling here is that you hit problems with floating point precision, as your Edm is within double precision of your FVAL. Can you re-define your likelihood to have values closer to zero around the minimum, e.g. by offsetting some terms? Then you won’t have numeric problems in the gradients inside Minuit. Are you using RooFit? Then you can do the offsetting automatically with the RooFit::Offset() argument to RooAbsPdf::fitTo() or RooAbsPdf::createNLL(). This should fix the floating precision problems of having FVAL and Edm differ by orders of magnitude that double precision can’t handle.

Thank you for the insight! I’m not using RooFit . I’m implementing a custom binned Poisson NLL directly in ROOT using Minuit2 via ROOT::Math::Minimizer. My likelihood is:

image

where \mu_i​ is the analytic prediction integrated over each bin and Ni​ is the weighted MC pseudo-data. The function is expected to be parabolic around the minimum. Following your suggestion, I will try offsetting the NLL by subtracting its value at the minimum (or at the SM point) to bring FVAL closer to zero. Would something like this be the correct approach?

// Offset by NLL at SM point (par = {0,0,0,0,1})
double par_SM[5] = {0, 0, 0, 0, 1};
double offset = CalculateNLL(par_SM);
// Then in NLL return: fval.Sum() - offset

Actually, I figured out that there was a small issue in the PDF implementation, which is now fixed and working properly. However, I am facing the same issue when using MC pseudo-data instead.

i obtained :

Warning in : VariableMetricBuilder Call limit exceeded
Warning in : VariableMetricBuilder FunctionMinimum is invalid, reached function call limit
Info in : VariableMetricBuilder Stop iterating after 56.8531 s
Warning in : CombinedMinimumBuilder Both migrad and method failed also at 2nd attempt; return simplex Minimum
Warning in : Minuit2Minimizer::Minimize Covar is not pos def
Minuit2Minimizer : Valid minimum - status = 5
FVAL = -383104.317746795423
Edm = 5.23577909916639328e-07
Nfcn = 34674
deltaAy = 0.00527183 +/- 0.0116539
deltaAz = -0.00238503 +/- 0.00533815
deltaBz = 0.00603975 +/- 0.0133312
deltaBy = 0 (fixed)
kappa = 0.945625 +/- 0.0318663

— Parameter Pulls —
deltaAy pull = 0.452366
deltaAz pull = -0.44679
deltaBz pull = 0.453054

I have attached small code for the Likelihood :

Likelihood_Minimization.txt (2.8 KB)

I greatly appreciate your assistance and valuable insights.

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