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.