Hi All,
I noticed that the package pcabuildbasis for principal component analysis has some weird behavior. I compared the results of pcabuildbasis with those obtained from Matlab pca (https://www.mathworks.com/help/stats/pca.html). Surprisingly, ALGLIB's pcabuildbasis and Matlab's pca give different results on the eigenvectors.
For example, given raw data A ={1.0,2.0,3.0;1.0,2.0,3.0;1.0,2.0,3.0;3.0,2.0,1.0}, pcabuildbasis returns the matrix for eigenvectors as {-0.7071, -0.7071, 0; -0.7071, 1.0, -9.26e+061; 0, -9.26e+061, -9.26e+061}, however, Matlab pca (https://www.mathworks.com/help/stats/pca.html) gives eigenvector matrix as {-0.7071, 0.7071, 0; 0, 0, 1.0; 0.7071, 0.7071, 0}. The results are totally different.
I tested two other data inputs (listed at the end), they also gave different results on the eigenvector. I'm totally confused with this problem. I'll be very grateful if you could help solve this problem!
Thanks much, Lin
Data Input2 = [1.0, 2.0, 3.0; 1.0, 3.0, 2.0; 3.0, 1.0, 2.0; 3.0, 2.0, 1.0 ]
Data Input3 = [7 26 6 60 1 29 15 52 11 56 8 20 11 31 8 47 7 52 6 33 11 55 9 22 3 71 17 6 1 31 22 44 2 54 18 22 21 47 4 26 1 40 23 34 11 66 9 12 10 68 8 12]
|