PCA can be determined by using the singular value decomposition (SVD) [5]

(3) |

where is a orthogonal matrix, is an orthogonal matrix and is a pseudodiagonal matrix (diagonal if ) with the singular values on the main diagonal [5]. The PCA solution is obtained by selecting the largest singular values from , by forming from the corresponding columns of , and from the corresponding rows of .

Note that PCA can equivalently be defined using the eigendecomposition of the covariance matrix of the column vectors of the data matrix :

Here, the diagonal matrix contains the eigenvalues of , and the columns of the matrix contain the unit-length eigenvectors of in the same order [6,4,2,5]. Again, the columns of corresponding to the largest eigenvalues are taken as , and is computed as . This approach can be more efficient for cases where , since it avoids the matrix.