0

I am working on the PCA. On the internet I found two different ways to compute it - but they produce different results.

First there is this solution: http://stanford.io/2060AxA . They are taking the mean out, doing $$ \Sigma = \frac{1}{m} \sum_{i=1}^m (x^{(i)})(x^{(i)})^T $$ then $$ SVD( \Sigma ) = U S V^T $$ and do $$ Y= U^T \cdot X$$ by taking $U$. Keep in mind that $U^T = V^T$, because you do SVD on a symmetric matrix.

The other way is proposed here: http://bit.ly/1Pk2Nid . There they are going for $$ X^T X = V \Lambda V^T$$ and define $U$ as $$U=XV\Lambda ^{-1/2} $$.

Who can explain the difference?

  • the second one computes the whitened features, not PCA (the two are related by the diagonal matrix $\Lambda^{1/2} = S^{1/2}$) and in your link they seem to have made a mistake with the covariance matrix $Y^T Y = diag(1_d,0)$ not $\Lambda$) – reuns Jan 27 '16 at 23:56
  • Thanks - did not expected such a big mistake in the document. –  Jan 30 '16 at 22:36

0 Answers0