Wrong parameter values printed by paramOn in RooFit

Hi, I am performing a 2D fit in RooFit.
Relevant commands used to fit are below:


RooFitResult* fitres =mdzdel1.fitTo(*ds1,Extended(kTRUE),Minos(1),NumCPU(4),Save());

I am calling MINUIT twice and using MINOS for error calculation.
I use paramOn to show parameters on frame but it doesn’t show the results from latest Migrad converged instance but earlier MIGRAD converged instance after which a new minimum is found.

How do I fix it to show the parameters from final MIGRAD converged instance also matching the MINOS results ?

I am attaching the log file. Its very big , but to get the point better strategy is to look for word “converged” in the log file.
I am also attaching the fit projection with paramOn the frame, compare to the final results in attached log file , they don’t match.signal_2d_mdz.pdf (23.7 KB)

Please let me know how to fix it.


I have two ideas:

  1. A bug when recording the parameter values. (Let’s rule out 2. first)
  2. Minuit is confused when you are starting a fit already in the minimum. It seems that you want to run a pre-fit, and then a fit with error estimation. Try kicking one of the parameters a little before running the second fit. Now, Minuit should see a proper gradient, be able to estimate reasonable step sizes, have an easier job to figure out when it converged.

Hi @StephanH ,

1> I am positive that’s not the problem as it works fine for lots of other fits I have done before.

2> Just to clarify more on what I am doing:
My first MINUIT call does not converge , then it goes to second MINUIT call which converge but with one of the parameter at limit.
After that when MINOS run it gives a message “NEW MINIMUM FOUND. GO BACK TO MINIMIZATION STEP.” and then MIGRAD converge without anything at the limit.

paramON is printing the parameters from the second MINUIT call for which MIGRAD converge but with a parameter at the limit and not the last one.

I have never seen that. Could it be that the parameter values are not updated when the fit fails?
Can you print the parameters after the different fit steps to confirm that? It should be something like:


using the pdf.getParameters(data)->Print("V"); I found that
the parameter values didn’t get updated after the MINOS found a new minimization
Could it be that the parameter values are not updated when the fit fails? I am not sure what failed fit (first one ? ) you are referring to here ?

First migrad -> fit failed, parameter updates,
Second migrad -> fit converged, parameter updates, MINOS report finding a minimum and now for the third migrad -> fit converged, the parameter doesn’t update.

It’s hard to say what’s going on. I guess you would have to provide us with a macro that we can run or attach the log file where you print the parameters at each step.

Attaching the :
Root version used: 6.18/04
Fit macro (Signal_2d.C) Signal_2d.C (15.2 KB)
Data txt files (signal_new.dat, scf_new.dat, fsr_new.dat) signal_new.txt (2.8 MB) scf_new.txt (12.1 KB) fsr_new.txt (21.4 KB)
Log file (resultff.txt). https://drive.google.com/open?id=1SXpNpZOWfMaK6krNB2kgYRtBLPTaBuOf

Screen shot of MIGRAD and parameter values printed at each step:
1> After the first MIGRAD

Para printed after first MIGRAD

2> After the second MINUIT call , result from MIGRAD

3> one parameter is at limit, now MINOS runs but finds a new MINIMUM and runs MIGARD again, result from that MIGARD run

4> Final results at the end of MINOS from second MINUIT call and the parameters printed

Fit projection with parameters using RooPlot *mdz_frame = M_dz.frame(); mdzdel1.paramOn(mdz_frame); . Parameters on frame doesn’t match the final MINOS result
signal_2d_mdz1.pdf (31.9 KB)

I ran your example, but the problem doesn’t seem to be in RooFit. RooFit just copies what it receives from the minimiser, and that’s the “old” values from the not-so-optimal minimum.

I notified @moneta to have a look at what MINUIT does in this case.

1 Like


It seems that the Minimiser does not update the parameter values and parabolic errors after Minos. I will fix this. However I noticed that if you run your fit with Minuit2 (using the option RooFit::Minimizer("Minuit2") seems to work much better and you don’t have this problem that a new Minimum that is found during Minos and the fit looks much faster


1 Like

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