0

I am a little bit confused on the first principal directions. Say I have three points in a two dimensional euclidean space: (1,1), (2,2), and (3,3) and I want to calculate the first principal component.

First I see that the center is (2,2) so I move all points to the origin. Now (2,2) is like (0,0) and (1,1) is (-1,-1) and (3,3) is (1,1). This is the mean shift. Now, I know that the first principal component is $(\frac{\sqrt{2}}{2}, \frac{\sqrt{2}}{2})^{T}$ from matlab. But, how is it calculating this? What does this mean?

Do you compute the covariance matrix then find the eigenvalues then the eigenvectors. This eigenvector is the direction? Then you normalize?

So we have our points after the mean shift at (-1,-1), (0,0), and (1,1). We now compute the covariance matrix

c(x,x) c(x,y)

c(y,x) c(y,y)

which is [0 1; 0 1] we then look at the largest eigenvalue 1 and compute the eigenvector which is [1;1]. Then we normalize so divide by $\sqrt{1^2 + 1^2}$?

amoeba
  • 93,463
  • 28
  • 275
  • 317
FrankTheFrank
  • 373
  • 1
  • 3
  • 4
  • 2
    Have you tried searching through all the related PCA threads first? Here are a few that might help: http://stats.stackexchange.com/questions/217995/what-is-an-intuitive-explanation-for-how-pca-turns-from-a-geometric-problem-wit or http://stats.stackexchange.com/questions/2691/making-sense-of-principal-component-analysis-eigenvectors-eigenvalues – ilanman Oct 13 '16 at 02:08
  • The covariance matrix of your three points is not [0 1; 0 1]. It is [1 1; 1 1]. The first eigenvector is [1; 1] though, that's correct. – amoeba Oct 13 '16 at 15:44

0 Answers0