forum.alglib.net http://forum.alglib.net/ |
|
Matrix after PCA is not orthogonal http://forum.alglib.net/viewtopic.php?f=2&t=3943 |
Page 1 of 1 |
Author: | Boy1 [ Tue Feb 12, 2019 5:21 am ] |
Post subject: | Matrix after PCA is not orthogonal |
Hi everyone, I want to apply PCA on my matrix. What I did is to call pcabuildbasis() function, get the eigVectors and then multiply my matrix with the eigVectors matrix. However when I check the correlation coefficient among columns after PCA, I find the last several columns are still correlated. Here is my code. Did I call pcabuildbasis() incorrectly? Or there is a bug in the PCA function itself? Code: int NumOfSamplePath=1000; int nofcoeffs=417; int i=1; alglib::real_2d_array ptInput; ptInput.setcontent(NumOfSamplePath, nofcoeffs - 12 * (i - 1), beta_var_value[i]); alglib::ae_int_t info; alglib::real_1d_array eigValues; alglib::real_2d_array eigVectors; alglib::pcabuildbasis(ptInput, NumOfSamplePath, nofcoeffs - 12 * (i - 1), info, eigValues, eigVectors); Thanks. |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |