MinuitMinimizer¶
-
class
minkit.MinuitMinimizer(evaluator, **minimizer_config)[source]¶ Bases:
minkit.MinimizerInterface with the
iminuit.Minuitclass. In the calls to the different methods of this class it is ensured that the parameters of the PDF(s) from the evaluator instance have their value set to that of the minimum after a minimization process.Parameters: evaluator (UnbinnedEvaluator, BinnedEvaluator or SimultaneousEvaluator) – evaluator to be used in the minimization. Attributes Summary
evaluatorEvaluator of the minimizer. minuitUnderlying iminuit.Minuitobject.Methods Summary
asymmetric_errors(name[, sigma, atol, rtol, …])Calculate the asymmetric errors for the given parameter. fcn_profile(wa, values)Evaluate the profile of an FCN for a set of parameters and values. hesse(*args, **kwargs)Arguments are forwarded to the iminuit.Minuit.hesse()function, and the values of the parameters are set to those from the minimization result.migrad(*args, **kwargs)Arguments are forwarded to the iminuit.Minuit.migrad()function, and the values of the parameters are set to those from the minimization result.minimization_profile(wa, values[, …])Minimize a PDF an calculate the FCN for each set of parameters and values. minimize(*args, **kwargs)Same as MinuitMinimizer.migrad(), but offering a common interface for all theMinimizerobjects.minos(*args, **kwargs)Arguments are forwarded to the iminuit.Minuit.minos()function, and the values of the parameters are set to those of the MINOS result.minos_profile(*args, **kwargs)Arguments are forwarded to the iminuit.Minuit.mnprofile()function.restoring_state()Method to ensure that modifications of parameters within a minimizer context are reset properly. set_parameter_state(name[, value, error, fixed])Method to ensure that a modification of a parameter within a minimizer context is treated properly. Attributes Documentation
-
evaluator¶ Evaluator of the minimizer.
-
minuit¶ Underlying
iminuit.Minuitobject.
Methods Documentation
-
asymmetric_errors(name, sigma=1, atol=1e-08, rtol=1e-05, max_call=None)¶ Calculate the asymmetric errors for the given parameter. This is done by subdividing the bounds of the parameter into two till the variation of the FCN is one. Unlike MINOS, this method does not treat new minima. Remember that the PDF must have been minimized before a call to this function.
Parameters:
-
fcn_profile(wa, values)¶ Evaluate the profile of an FCN for a set of parameters and values.
Parameters: - wa (str or list(str)) – single variable or set of variables.
- values (numpy.ndarray) – values for each parameter specified in wa.
Returns: Profile of the FCN for the given values.
Return type:
-
hesse(*args, **kwargs)[source]¶ Arguments are forwarded to the
iminuit.Minuit.hesse()function, and the values of the parameters are set to those from the minimization result.Returns: Output from iminuit.Minuit.hesse().
-
migrad(*args, **kwargs)[source]¶ Arguments are forwarded to the
iminuit.Minuit.migrad()function, and the values of the parameters are set to those from the minimization result.Returns: output from iminuit.Minuit.migrad().See also
-
minimization_profile(wa, values, minimization_results=False, minimizer_config=None)[source]¶ Minimize a PDF an calculate the FCN for each set of parameters and values.
Parameters: - wa (str or list(str)) – single variable or set of variables.
- values (numpy.ndarray) – values for each parameter specified in wa.
- minimization_results (bool) – if set to True, then the results for each step are returned.
- minimizer_config (dict or None) – arguments passed to
Minimizer.minimize().
Returns: Profile of the FCN for the given values.
Return type: numpy.ndarray, (list(MinimizationResult))
-
minimize(*args, **kwargs)[source]¶ Same as
MinuitMinimizer.migrad(), but offering a common interface for all theMinimizerobjects. It returns a tuple with the information whether the minimization succeded and the covariance matrix.See also
-
minos(*args, **kwargs)[source]¶ Arguments are forwarded to the
iminuit.Minuit.minos()function, and the values of the parameters are set to those of the MINOS result. If a new minimum is found, the value of the parameter is set accordingly.Returns: output from iminuit.Minuit.minos().See also
-
minos_profile(*args, **kwargs)[source]¶ Arguments are forwarded to the
iminuit.Minuit.mnprofile()function.
-
restoring_state()[source]¶ Method to ensure that modifications of parameters within a minimizer context are reset properly. Sadly, the
iminuit.Minuitclass is not stateless, so each time a parameter is modified it must be notified of the change.Warning
This does not preserve the minimization state of MIGRAD.
-
set_parameter_state(name, value=None, error=None, fixed=None)¶ Method to ensure that a modification of a parameter within a minimizer context is treated properly. Sadly, the
iminuit.Minuitclass is not stateless, so each time a parameter is modified it must be notified of the change.Parameters:
-