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

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

Warning: 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 asymetric or non-parabolic shaped profiles well, this method is preferable.

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

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

  • cl (Optional[float]) – Confidence Level of the parameter to be determined. Defaults to 68.3%.

  • rtol (Optional[float]) – relative tol between the computed and the exact roots

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

  • covariance_method (Union[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.

  • sigma (float) – Errors are calculated with respect to sigma std deviations.


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