I have 2 eigen vectors sets X
and Y
with size=(7,7)
(so 7 eigen vectors of 7 components).
I am looking for a way to build a covariance matrix from these 2 eigen vectors sets.
In a first time, I did the function :
# Compute covariance between vectors of matrix
def compute_Cov(A,B):
C = np.zeros((7,7))
for i in range(7):
C[0:7,i]= np.mean(A[0:7,i]*B[0:7,i]) - np.mean(A[0:7,i])*np.mean(B[0:7,i])
#C[0:7,i] = np.cov(A[0:7,i],B[0:7,i])
return C
and calling : CovXY = compute_Cov(X,Y)
But this way, the matrix CovXY
is not symetric and I don't know how to build a symmetric matrix from X
and Y
eigen vectors sets (so X and Y are actually matrices).