Calculating the eigenvalues of the covariance matrix