# Fit Convergence with Status 5

**URL:** <https://root-forum.cern.ch/t/fit-convergence-with-status-5/64745>\
**Category:** Roofit and RooStats\
**Created:** [March 10, 2026, 1:23pm UTC](https://root-forum.cern.ch/t/fit-convergence-with-status-5/64745 "2026-03-10T13:23:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mustaphaa](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mustaphaa/32/36678_2.png) [@Mustaphaa](https://root-forum.cern.ch/u/Mustaphaa)\
**Post date:** [March 10, 2026, 1:23pm UTC](https://root-forum.cern.ch/t/fit-convergence-with-status-5/64745/1 "2026-03-10T13:23:08Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [March 10, 2026, 1:43pm UTC](https://root-forum.cern.ch/t/fit-convergence-with-status-5/64745/2 "2026-03-10T13:43:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jonas](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jonas/32/24756_2.png) [@jonas](https://root-forum.cern.ch/u/jonas)\
**Post date:** [March 10, 2026, 11:07pm UTC](https://root-forum.cern.ch/t/fit-convergence-with-status-5/64745/3 "2026-03-10T23:07:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mustaphaa](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mustaphaa/32/36678_2.png) [@Mustaphaa](https://root-forum.cern.ch/u/Mustaphaa)\
**Post date:** [March 11, 2026, 3:40am UTC](https://root-forum.cern.ch/t/fit-convergence-with-status-5/64745/4 "2026-03-11T03:40:41Z")

</div>

> [@jonas](#):
>
> 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](https://root-forum.cern.ch/uploads/default/original/3X/6/d/6dea84730a169232105e6d73d131ec2828f22925.png)

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](https://root-forum.cern.ch/uploads/short-url/u0BWCltoJaUi9bRod6bRgY5ElDw.txt) (2.8 KB)

I greatly appreciate your assistance and valuable insights.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [March 25, 2026, 3:59am UTC](https://root-forum.cern.ch/t/fit-convergence-with-status-5/64745/5 "2026-03-25T03:59:32Z")

</div>

Closed on March 25, 2026, 3:59am UTC

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