I'd like to speed up a principal value value analysis. The data contains a large set of vectors with a large dimension. Both are in the range of 1000. I want to obtain the loadings matrix for further calculations. The "Eigenvectors" part takes most of the computation time.

lMat = Table[RandomReal[], {i, 1000}, {j, 2000}]; 
mwVec = Mean[lMat]; 
lVerMat = (# - mwVec) & /@ lMat (* translation to the mean *); 
covarMat = Covariance[lVerMat]; 
loadMat = Eigenvectors[covarMat] (* loadings matrix *); //AbsoluteTiming 
lHKMat = lVerMat.Transpose[loadMat];

Thanks in advance.

  • 3
    $\begingroup$ Why not use the built-in function PrincipalComponents? $\endgroup$ – kglr Sep 8 '14 at 15:00
  • $\begingroup$ The loadings matrix and the mean values should be fixed for the transformation of additional data. PrincipalComponents yields just the result and not the tranformation rules. $\endgroup$ – AWi Sep 10 '14 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.