Perform principle component analysis (PCA) using singular value decomposition (SVD)
One method for performing PCA on a matrix and getting its factor loadings and eigenvalues is to use SVD as follows:
Given matrix
In pseudo-code:
const C = correlationMatrix(M)
const { U, S, VT } = svd(C)
const loadings = U
const eigenvalues = flatten(S).filter(v => v > 0)