Merge branch 'develop' into documentation

This commit is contained in:
fjosw 2022-03-04 11:11:41 +00:00
commit d6c7bbd465

View file

@ -1354,6 +1354,11 @@ def covariance(obs, visualize=False, correlation=False, **kwargs):
'''
length = len(obs)
max_samples = np.max([o.N for o in obs])
if max_samples <= length:
warnings.warn(f"The dimension of the covariance matrix ({length}) is larger or equal to the number of samples ({max_samples}). This will result in a rank deficient matrix.", RuntimeWarning)
cov = np.zeros((length, length))
for i in range(length):
for j in range(i, length):