MATLAB: Are the PCA scores not othogonal after Varimax Rotation

matlab pca rotation orthogonal

I have some data X, say 100 rows, 5 variables. I perform PCA…
[coeff,score,latent,tsquared,explained,mu] = pca(X);
I check by coeff and scores are orthogonal…
coeff'*coeff
ans =
1.0000 0.0000 0.0000 -0.0000 0.0000
0.0000 1.0000 0.0000 -0.0000 -0.0000
0.0000 0.0000 1.0000 -0.0000 -0.0000
-0.0000 -0.0000 -0.0000 1.0000 -0.0000
0.0000 -0.0000 -0.0000 -0.0000 1.0000
corrcoef(score)
ans =
1.0000 -0.0000 0.0000 -0.0000 -0.0000
-0.0000 1.0000 0.0000 -0.0000 0.0000
0.0000 0.0000 1.0000 0.0000 0
-0.0000 -0.0000 0.0000 1.0000 0.0000
-0.0000 0.0000 0 0.0000 1.0000
I perform what I believe to be an orthogonal Rotation:
nu_coeff=rotatefactors(coeff(:,1:3),'Method','varimax')
I check my nu coefficient matrix is othoganal:
nu_coeff'*nu_coeff
ans =
1.0000 0.0000 0.0000
0.0000 1.0000 0.0000
0.0000 0.0000 1.0000
finally I test whether my new scores are orthogonal:
nu_score=X*nu_coeff
corrcoef(nu_score)
ans =
1.0000 0.4390 0.8389
0.4390 1.0000 0.4446
0.8389 0.4446 1.0000
to my horror they are not….
What am I doing wrong?

Best Answer

I guess I can partially answer my own question, the short answer is scores will not be orthogonal although coefficients or "Eigen vectors" will. An easy way to see this, is as follows:
If we work in R5 space, i.e. have 5 variables and attempt the following Varimax rotation, i.e. including the complete coefficient matrix...(Eigen Vector)
nu_coeff=rotatefactors(coeff(:,1:5),'Method','varimax')
The rotated factor loadings nu_coeff will be an identify matrix
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
Each variable loading onto one factor, the new coefficient matrix will still be orthogonal.... but each score is just the original data hence the correlation between the variables in X will be the same as the correlation between the factors in score.
corrcoef(score)==corrcoef(X)