function eig_corr¶
- deeptime.numeric.eig_corr(C0, Ct, epsilon=1e-10, method='QR', canonical_signs=False, return_rank=False)¶
Solve generalized eigenvalue problem with correlation matrices C0 and Ct
Numerically robust solution of a generalized Hermitian (symmetric) eigenvalue problem of the form
Computes dominant eigenvalues and eigenvectors , where is the numerical rank of the problem. This is done by first conducting a Schur decomposition of the symmetric positive matrix , then truncating its spectrum to retain only eigenvalues that are numerically greater than zero, then using this decomposition to define an ordinary eigenvalue Problem for of size , and then solving this eigenvalue problem.
- Parameters:
C0 (ndarray (n,n)) – time-instantaneous correlation matrix. Must be symmetric positive definite
Ct (ndarray (n,n)) – time-lagged correlation matrix. Must be symmetric
epsilon (float) – eigenvalue norm cutoff. Eigenvalues of C0 with norms <= epsilon will be cut off. The remaining number of Eigenvalues define the size of the output.
method (str) –
Method to perform the decomposition of before inverting. Options are:
’QR’: QR-based robust eigenvalue decomposition of W
’schur’: Schur decomposition of W
canonical_signs (bool) – If True, re-scale each eigenvector such that its entry with maximal absolute value is positive.
return_rank (bool, default=False) – If True, return the rank of generalized eigenvalue problem.
- Returns:
l (ndarray (m)) – The first m generalized eigenvalues, sorted by descending norm
R (ndarray (n,m)) – The first m generalized eigenvectors, as a column matrix.
rank (int) – Rank of , if return_rank is True.