title: Apply PCA on very large sparse matrix
body: <p>I am doing a text classification task with R, and I obtain a document-term matrix with size 22490 by 120,000 (only 4 million non-zero entries, less than 1% entries). Now I want to reduce the dimensionality by utilizing PCA (Principal Component Analysis). Unfortunately, R cannot handle this huge matrix, so I store this sparse matrix in a file in the "Matrix Market Format", hoping to use some other techniques to do PCA.</p>
  
  <p>So could anyone give me some hints for useful libraries (whatever the programming language), which could do PCA with this large-scale matrix with ease, or do a longhand PCA by myself, in other words, <strong><em>calculate the covariance matrix at first, and then calculate the eigenvalues and eigenvectors for the covariance matrix</em></strong>. </p>
  
  <p>What I want is to <strong><em>calculate all PCs (120,000), and choose only the top N PCs, who accounts for 90% variance</em></strong>. Obviously, in this case, I have to give a threshold a priori to set some very tiny variance values to 0 (in the covariance matrix), otherwise, the covariance matrix will not be sparse and its size would be 120,000 by 120,000, which is impossible to handle with one single machine. Also, the loadings (eigenvectors) will be extremely large, and should be stored in sparse format. </p>
  
  <p>Thanks very much for any help !</p>
  
  <p>Note: I am using a machine with 24GB RAM and 8 cpu cores. </p>