From 59d22fceeefd3d69bb3e9f7f16e94a38ced079da Mon Sep 17 00:00:00 2001 From: ppetrak Date: Mon, 30 Jan 2023 15:16:41 +0100 Subject: [PATCH] fix: reduced the migrad solver tolerance + removed unnecessary check --- pyerrors/fits.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pyerrors/fits.py b/pyerrors/fits.py index f76532e6..4a2680f4 100644 --- a/pyerrors/fits.py +++ b/pyerrors/fits.py @@ -713,9 +713,6 @@ def _combined_fit(x, y, func, silent=False, **kwargs): if sorted(list(func.keys())) != key_ls: raise Exception('x and func dictionaries do not contain the same keys.') - if sorted(list(func.keys())) != sorted(list(y.keys())): - raise Exception('y and func dictionaries do not contain the same keys.') - x_all = np.concatenate([np.array(x[key]) for key in key_ls]) y_all = np.concatenate([np.array(y[key]) for key in key_ls]) @@ -768,7 +765,7 @@ def _combined_fit(x, y, func, silent=False, **kwargs): if output.method != 'Levenberg-Marquardt': if output.method == 'migrad': - tolerance = 1e-1 # default value set by iminuit + tolerance = 1e-4 # default value of 1e-1 set by iminuit can be problematic if 'tol' in kwargs: tolerance = kwargs.get('tol') fit_result = iminuit.minimize(chisqfunc, x0, tol=tolerance) # Stopping criterion 0.002 * tol * errordef