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
\[\mathbf{C}_t \mathbf{r}_i = \mathbf{C}_0 \mathbf{r}_i l_i \]Computes \(m\) dominant eigenvalues \(l_i\) and eigenvectors \(\mathbf{r}_i\), where \(m\) is the numerical rank of the problem. This is done by first conducting a Schur decomposition of the symmetric positive matrix \(\mathbf{C}_0\), 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 \(\mathbf{C}_t\) of size \(m\), 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 \(W\) 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 \(C0^{-0.5}\), if return_rank is True.