0

When I get the eigenvalues of the diagonal of a PCA transformed image, I always get 1, whatever the image. What's the reason behind this?

I used the following code.

coeff = pca(pmap);
disp(coeff);

[V,L]=eig (coeff'*coeff);
Lamda = diag(L);
disp(Lamda);
Adriaan
  • 17,741
  • 7
  • 42
  • 75
N.Chandimali
  • 799
  • 1
  • 8
  • 23
  • 1
    In short, pca is eig. – Ander Biguri Jun 06 '18 at 14:00
  • 1
    Seeing this in conjuncture with [the question you asked yesterday](https://stackoverflow.com/q/50701868/5211833) I advice you to study PCA from a book on maths, since your perception/understanding of it seems to be lacking. First find out what you want to achieve, then try to determine whether PCA is the correct tool for that, and if it is, start studying it and only then implement it. It looks like you have this route backwards. – Adriaan Jun 06 '18 at 14:05

1 Answers1

2

The coeff which pca outputs are already eigenvectors, which are all orthogonal. They are even orthonormal, since MATLAB normalises them. Relative weight is in the explained output parameter of pca.

So transpose(coeff)*coeff gives you the identity matrix, which just contains ones and the eigenvectors of the identity matrix are, obviously, all just 1 in a single dimension.

The reason is thus because that's how linear algebra works.

Adriaan
  • 17,741
  • 7
  • 42
  • 75