pflm.fpca.utils.get_eigen_analysis_results#
- get_eigen_analysis_results(reg_cov: ndarray, is_upper_triangular: bool = False) tuple[ndarray, ndarray][source][source]#
Compute eigenvalues and eigenvectors of a covariance matrix.
- Parameters:
- reg_covnp.ndarray of shape (nt, nt)
Regularized covariance matrix. Dtype determines the LAPACK routine (float64 -> f64 backend; otherwise f32).
- is_upper_triangularbool, default=False
Whether reg_cov contains only the upper triangular part (packed in a full matrix). If True, the routine will treat the lower part as unspecified.
- Returns:
- eig_lambdanp.ndarray of shape (k,)
Sorted eigenvalues (descending) filtered to positive and finite values.
- eig_vectornp.ndarray of shape (nt, k)
Corresponding eigenvectors (columns) aligned with eig_lambda.
- Warns:
- UserWarning
If the LAPACK routine fails (info != 0) or eigenvalues contain NaN or negative values.
Notes
Very small eigenvalues (<= 10 * eps) are discarded.
On failure, the function returns (None, None).