simultaneous_minimizer¶
-
minkit.
simultaneous_minimizer
(categories, minimizer='minuit', minimizer_config=None, constraints=None, range='full', weights_treatment='rescale')[source]¶ Create a new object to minimizer a
PDF
. The bounds of the data parameters must not change in the process. Changes to the values, errors or the constant state of the parameters must be done through theMinimizer.set_parameter_state()
method.- Parameters
minimizer (str) – minimizer to use (minuit or scipy).
minimizer_config (dict) – any extra configuration to be passed to the minimizer. For minuit, the argument forced_parameters is unavailable.
constraints (list(PDF)) – set of constraints to consider in the minimization.
range (str) – range of data to minimize.
weights_treatment (str) – what to do with weighted samples (see below for more information).
- Returns
Minimizer to call.
- Return type
The treatment of weights when calculating FCNs can lead to unreliable errors for the parameters. In general there is no correct way of processing the likelihoods. In this package the following methods are supported:
none: the raw weights are used to calculate the FCN. This will lead to completely incorrect uncertainties, since the statistical weight of the events in the data sample will not be proportional to the sample weight.
rescale: in this case the weights are rescaled so \(\omega^\prime_i = \omega_i \times \frac{\sum_{j = 0}^n \omega_j}{\sum_{j = 0}^n \omega_j^2}\). In this case the statistical weight of each event is proportional to the sample weight, although the uncertainties will still be incorrect.
Warning
Do not change the bounds of the data parameters, since for unbinned data sets a new sample is internally created with values falling in range. The weights of the sample are also changed according to the weights_treatment argument.
It is also very important that any change to the state of a parameter within a minimization context is done using the
Minimizer.set_parameter_state()
method.