mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
feat: warning for ill conditioned correlation matrix in correlated fit
only triggered for condition number > 1e13.
This commit is contained in:
parent
06f2861390
commit
6c6a0f367e
1 changed files with 1 additions and 1 deletions
|
@ -486,7 +486,7 @@ def _standard_fit(x, y, func, silent=False, **kwargs):
|
|||
condn = np.linalg.cond(corr)
|
||||
if condn > 0.1 / np.finfo(float).eps:
|
||||
raise Exception(f"Cannot invert correlation matrix as its condition number exceeds machine precision ({condn:1.2e})")
|
||||
if condn > 1 / np.sqrt(np.finfo(float).eps):
|
||||
if condn > 1e13:
|
||||
warnings.warn("Correlation matrix may be ill-conditioned, condition number: {%1.2e}" % (condn), RuntimeWarning)
|
||||
chol = np.linalg.cholesky(corr)
|
||||
chol_inv = scipy.linalg.solve_triangular(chol, covdiag, lower=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue