mescla.emma.pca.eigen_decomposition

mescla.emma.pca.eigen_decomposition(Z, species=None)[source]

Eigen-decomposition of the covariance of Z.

Parameters:
  • Z (ndarray, shape (n_samples, n_species)) – Standardised (or at least centred) data. If Z was z-scored, its covariance is the correlation matrix of the raw data and the eigenvalues sum to the number of species – which is what makes the “rule of one” meaningful.

  • species (tuple of str, optional)

Returns:

EigenStructure

Return type:

EigenStructure

Notes

Uses numpy.linalg.eigh(), valid because the covariance matrix is symmetric positive semi-definite. Tiny negative eigenvalues from round-off are clipped to zero.