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)
A bug when recording the parameter values. (Let’s rule out 2. first)
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.
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 ?
Summary:
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.
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.
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