diff --git a/docs/pyerrors/obs.html b/docs/pyerrors/obs.html index 6cfd4ea9..4ca2bf3a 100644 --- a/docs/pyerrors/obs.html +++ b/docs/pyerrors/obs.html @@ -1765,23 +1765,23 @@ 1452 if isinstance(smooth, int): 1453 corr = _smooth_eigenvalues(corr, smooth) 1454 -1455 errors = [o.dvalue for o in obs] -1456 cov = np.diag(errors) @ corr @ np.diag(errors) -1457 -1458 eigenvalues = np.linalg.eigh(cov)[0] -1459 if not np.all(eigenvalues >= 0): -1460 warnings.warn("Covariance matrix is not positive semi-definite (Eigenvalues: " + str(eigenvalues) + ")", RuntimeWarning) -1461 -1462 if visualize: -1463 plt.matshow(corr, vmin=-1, vmax=1) -1464 plt.set_cmap('RdBu') -1465 plt.colorbar() -1466 plt.draw() -1467 -1468 if correlation is True: -1469 return corr -1470 else: -1471 return cov +1455 if visualize: +1456 plt.matshow(corr, vmin=-1, vmax=1) +1457 plt.set_cmap('RdBu') +1458 plt.colorbar() +1459 plt.draw() +1460 +1461 if correlation is True: +1462 return corr +1463 +1464 errors = [o.dvalue for o in obs] +1465 cov = np.diag(errors) @ corr @ np.diag(errors) +1466 +1467 eigenvalues = np.linalg.eigh(cov)[0] +1468 if not np.all(eigenvalues >= 0): +1469 warnings.warn("Covariance matrix is not positive semi-definite (Eigenvalues: " + str(eigenvalues) + ")", RuntimeWarning) +1470 +1471 return cov 1472 1473 1474def _smooth_eigenvalues(corr, E): @@ -5026,23 +5026,23 @@ Currently only works if ensembles are identical (this is not strictly necessary) 1453 if isinstance(smooth, int): 1454 corr = _smooth_eigenvalues(corr, smooth) 1455 -1456 errors = [o.dvalue for o in obs] -1457 cov = np.diag(errors) @ corr @ np.diag(errors) -1458 -1459 eigenvalues = np.linalg.eigh(cov)[0] -1460 if not np.all(eigenvalues >= 0): -1461 warnings.warn("Covariance matrix is not positive semi-definite (Eigenvalues: " + str(eigenvalues) + ")", RuntimeWarning) -1462 -1463 if visualize: -1464 plt.matshow(corr, vmin=-1, vmax=1) -1465 plt.set_cmap('RdBu') -1466 plt.colorbar() -1467 plt.draw() -1468 -1469 if correlation is True: -1470 return corr -1471 else: -1472 return cov +1456 if visualize: +1457 plt.matshow(corr, vmin=-1, vmax=1) +1458 plt.set_cmap('RdBu') +1459 plt.colorbar() +1460 plt.draw() +1461 +1462 if correlation is True: +1463 return corr +1464 +1465 errors = [o.dvalue for o in obs] +1466 cov = np.diag(errors) @ corr @ np.diag(errors) +1467 +1468 eigenvalues = np.linalg.eigh(cov)[0] +1469 if not np.all(eigenvalues >= 0): +1470 warnings.warn("Covariance matrix is not positive semi-definite (Eigenvalues: " + str(eigenvalues) + ")", RuntimeWarning) +1471 +1472 return cov