MINOS uncertainties failed to be calculated for some parameters in Fit::Fitter


ROOT Version: 6.10/04 (running on LXPLUS)
Platform: SL6 (LXPLUS)
Compiler: g++ 6.2.0 (presumably, I’m not sure how to get that from root-config)


In PyROOT I’m constructing a ROOT::Fit::Fitter and then attempting to perform a fit with MINOS uncertainties.

Inside a fitting function the fit is constructed and then performed as such

# This is inside of a function that takes certain parameters, which are not defined here. I can add later if wanted.

# Create a fitter
this_Fitter = ROOT.Fit.Fitter()
this_Fitter.Config().MinimizerOptions().SetMinimizerType('Minuit2')
# Minimize is a combination of Migrad and Simplex
# https://root.cern.ch/root/htmldoc/guides/users-guide/FittingHistograms.html#new-rootfit-classes
this_Fitter.Config().MinimizerOptions().SetMinimizerAlgorithm('Minimize')
this_Fitter.Config().MinimizerOptions().SetMaxIterations(1000000)
this_Fitter.Config().MinimizerOptions().SetMaxFunctionCalls(100000)
this_Fitter.Config().MinimizerOptions().SetStrategy(1)
this_Fitter.Config().SetMinosErrors()  # Turn MINOS on
this_Fitter.Config().SetUpdateAfterFit()  # Set paramters to fit result

# Create function
this_Functor = FitFunction(hist_to_fit, model, fit_range) # This is a class that inherits from ROOT.TPyMultiGenFunction so as to be usable by the fit

aParams = array.array('d', init_params)
aSteps = array.array('d', [0.01] * this_Functor.NDim())
this_Fitter.Config().SetParamsSettings(this_Functor.NDim(), aParams, aSteps)

# some stuff is done here to impose bounds
    
# Run the fit
this_Fitter.FitFCN(this_Functor)
    
print('MINOS uncert actually performed? {}'.format(
    this_Fitter.CalculateMinosErrors()))
result = ROOT.TFitResult(this_Fitter.Result())
print('fit result paramters')
print([result.Parameter(index) for index in range(result.NPar())])
print('lower, uppper MINOS uncert')
print([(result.LowerError(index), result.UpperError(index))
       for index in range(result.NPar())])
return result

later from outside this function is called

fitresult = do_the_fit(stuff)
fitresult.Print('V')

resulting in some example output like the following

MINOS uncert actually performed? True
fit result paramters
[260129.67509556608, -19.7481953157707, 49.77154819522133, -62.054378336095624, 27.899695549113233, 0.9721094244071828]
lower, uppper MINOS uncert
[(3070.5583880112536, 3070.5583880112536), (0.04345806522217188, 0.04345806522217188), (0.07612601734777513, 0.07612601734777513), (0.12239167559851438, 0.12239167559851438), (0.1169098125378838, 0.1169098125378838), (-0.16285427481497156, 0.2619734059918487)]

****************************************
Minimizer is Minuit2 / Minimize
MinFCN                    =      31.7627
NDf                       =            0
Edm                       =  2.92165e-06
NCalls                    =          286
Par_0                     =       260130   +/-   3070.56      	 (limited)
Par_1                     =     -19.7482   +/-   0.0434581    	 (limited)
Par_2                     =      49.7715   +/-   0.076126     	 (limited)
Par_3                     =     -62.0544   +/-   0.122392     	 (limited)
Par_4                     =      27.8997   +/-   0.11691      	 (limited)
Par_5                     =     0.972109   +/-   0.151311     	 (limited)

Covariance Matrix:

            	       Par_0       Par_1       Par_2       Par_3       Par_4       Par_5
Par_0       	  9.4865e+06     -104.02      25.331      78.547     -10.698     -200.82
Par_1       	     -104.02   0.0018887  -0.0019669 -0.00098339   0.0015277  0.00016225
Par_2       	      25.331  -0.0019669   0.0057954   -0.003951 -0.00078522   0.0017815
Par_3       	      78.547 -0.00098339   -0.003951    0.014977   -0.011507   0.0012777
Par_4       	     -10.698   0.0015277 -0.00078522   -0.011507    0.013666  -0.0031049
Par_5       	     -200.82  0.00016225   0.0017815   0.0012777  -0.0031049    0.022896

Correlation Matrix:

            	       Par_0       Par_1       Par_2       Par_3       Par_4       Par_5
Par_0       	           1    -0.77707     0.10803     0.20838   -0.029711    -0.43091
Par_1       	    -0.77707           1    -0.59451    -0.18489     0.30069    0.024672
Par_2       	     0.10803    -0.59451           1    -0.42408   -0.088231     0.15465
Par_3       	     0.20838    -0.18489    -0.42408           1    -0.80432       0.069
Par_4       	   -0.029711     0.30069   -0.088231    -0.80432           1    -0.17552
Par_5       	    -0.43091    0.024672     0.15465       0.069    -0.17552           1

It can be seen that symmetric uncertainties were found for the first 5 parameters and MINOS uncertainties were found for the 6th parameter. What has happened such that MINOS uncertainties were not found for all 6?

Hi,

This looks strange. Can you please tell me what is the output of Minuit2 (Migrad and Minos).
Maybe add the option

 this_Fitter.Config().MinimizerOptions().SetPrintLevel(1)

Cheers

Lorenzo

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