PTB-M4D / PyDynamic

Python library for the analysis of dynamic measurements
https://ptb-m4d.github.io/PyDynamic/
GNU Lesser General Public License v3.0
25 stars 13 forks source link

Covariance of GUM_iDFT is not symmetric for full input covariance #314

Closed mgrub closed 6 months ago

mgrub commented 1 year ago

When using the GUM_iDFT function with a full covariance matrix, the covariance of the output is not symmetric.

from PyDynamic.uncertainty.propagate_DFT import GUM_iDFT
import scipy.linalg as scl

NX = 6
X = np.arange(NX) + 2
X_cov = scl.toeplitz(0.01 * np.arange(NX)[::-1])
x, x_cov = GUM_iDFT(X, X_cov)

print(scl.issymmetric(x_cov, atol=1e-17))

The covariance is expected to be (1) symmetric and (2) should correspond roughly to the Monte Carlo uncertainty evaluation.