From 155c32992169b4275a0cbe08a1b0b1a2939cb47e Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Mon, 6 Jun 2022 15:47:41 +0100 Subject: [PATCH] fix: bug in error propagation for correlated fits fixed. --- pyerrors/fits.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyerrors/fits.py b/pyerrors/fits.py index 6c7ea066..489c2f8b 100644 --- a/pyerrors/fits.py +++ b/pyerrors/fits.py @@ -559,7 +559,10 @@ def _standard_fit(x, y, func, silent=False, **kwargs): fitp = fit_result.x try: - hess = jacobian(jacobian(chisqfunc))(fitp) + if kwargs.get('correlated_fit') is True: + hess = jacobian(jacobian(chisqfunc_corr))(fitp) + else: + hess = jacobian(jacobian(chisqfunc))(fitp) except TypeError: raise Exception("It is required to use autograd.numpy instead of numpy within fit functions, see the documentation for details.") from None