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 transpose((sqrt(2)/2, sqrt(2)/2)) 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)?