From 09fd1fdf608e30e1e98bf5f2d560b5a9351d575a Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Fri, 27 May 2022 13:50:19 +0100 Subject: [PATCH] feat: rounding errors in inversion of cholesky decomposed correlation matrix reduced. --- pyerrors/fits.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyerrors/fits.py b/pyerrors/fits.py index 16fb5405..45c8081c 100644 --- a/pyerrors/fits.py +++ b/pyerrors/fits.py @@ -477,8 +477,7 @@ def _standard_fit(x, y, func, silent=False, **kwargs): if condn > 1 / np.sqrt(np.finfo(float).eps): warnings.warn("Correlation matrix may be ill-conditioned, condition number: {%1.2e}" % (condn), RuntimeWarning) chol = np.linalg.cholesky(corr) - chol_inv = np.linalg.inv(chol) - chol_inv = np.dot(chol_inv, covdiag) + chol_inv = scipy.linalg.solve(chol, covdiag) def chisqfunc_corr(p): model = func(p, x)