compute_errors#

zfit.result.compute_errors(result, params, cl=None, rtol=None, method=None, covariance_method=None, sigma=None)[source]#

Compute asymmetric errors of parameters by profiling the loss function in the fit result. (deprecated arguments)

Deprecated: SOME ARGUMENTS ARE DEPRECATED: (sigma). They will be removed in a future version. Instructions for updating: Use cl for confidence level instead.

This method finds the value for a given parameter where the loss function is cl away: for example for a cl of 68.3%, this is one (multiplied by the errordef). The other parameters are also minimized and not fixed. This method is comparably computationally intensive and, if possible, hesse should be used. However, since hesse does not capture asymmetric or non-parabolic shaped profiles well, this method is preferable.

Parameters:
  • result (FitResult) – fit result to be used to compute the uncertainties.

  • params (list[ZfitIndependentParameter]) – The parameters to calculate the error. If None, use all parameters.

  • cl (float | None) – Confidence Level of the parameter to be determined. Defaults to 68.3%.

  • rtol (float | None) – relative tol between the computed and the exact roots

  • method (str | None) – type of solver, method argument of scipy.optimize.root(). Defaults to “hybr”.

  • covariance_method (str | Callable | None) – The method to use to calculate the correlation matrix, will be forwarded directly to FitResult.covariance(). Valid choices are by default {‘minuit_hesse’, ‘hesse_np’} (or any other method defined in the result) or a Callable.

Returns:

A dict containing as keys the parameter and as value a dict which

contains two keys ‘lower’ and ‘upper’, holding the calculated errors. Example: result[par1][‘upper’] -> the asymmetric upper error of ‘par1’

out: a fit result is returned when a new minimum is found during the loss scan

Return type:

out