PCA: What is wrong with this algorithm?

Can someone ask you to confirm or correct this Wikipedia algorithm to calculate the first main component? I want a simple PCA implementation in D that does not have existing libraries for PCA AFAIK. I tried to implement this, and it doesn’t seem like my results on simple examples match what I get from R or Octave. I am sure that this is not an implementation error, because I checked my implementation several times and even rewrote it from scratch, and this is a fairly simple algorithm.

+4
source share
1 answer

Is your data matrix a null value as preconditions require?

At this point, the code fragment is unclear, but as the data matrix is ​​originally described, I think that in order to use the power method, the column must be zero.

+5
source