I have been testing the princomp() function in MATLAB:
As part of the answer given there they pointed me to a this thread:
This contains a link to a tutorial on PCA (which is wonderful!) included in the tutorial is MATLAB code to calculate PCA's based on eigen-vectors and SVD. The answers produced by the three functions are consistent except for the fact that the Principal components for the SVD method in the tutorial is the negative of the eigen-vector based answer? Princomp() also uses SVD to compute its answer but then alters the principal componets to ensure that the largest element in each column is positive. After this seemingly rather ad-hock adjustment the result from Princomp() matches the one from the eigen-vector based approach exactly. Prior to this change Princomp() matches the results from the SVD based method exactly.
It just strikes me as odd that such adjustments are necessary!
1.) why do the eigenvalue and SVD based methods not match without this adjustment?
2.) More generally when should I always ensure that the largest element in each column has positive sign?
3.) Is there a mathematical reason for doing so? Or is it simply convention?