Algorithm 971: An Implementation of a Randomized Algorithm for Principal Component Analysis

ACM Trans Math Softw. 2017 Jan;43(3):28. doi: 10.1145/3004053.

Abstract

Recent years have witnessed intense development of randomized methods for low-rank approximation. These methods target principal component analysis and the calculation of truncated singular value decompositions. The present article presents an essentially black-box, foolproof implementation for Mathworks' MATLAB, a popular software platform for numerical computation. As illustrated via several tests, the randomized algorithms for low-rank approximation outperform or at least match the classical deterministic techniques (such as Lanczos iterations run to convergence) in basically all respects: accuracy, computational efficiency (both speed and memory usage), ease-of-use, parallelizability, and reliability. However, the classical procedures remain the methods of choice for estimating spectral norms and are far superior for calculating the least singular values and corresponding singular vectors (or singular subspaces).

Keywords: Algorithms; PCA; Performance; Principal component analysis; SVD; singular value decomposition.