Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
strange: correlated principal components after orthogonal rotation

Subject: strange: correlated principal components after orthogonal rotation

From: Roland Neumann

Date: 23 Oct, 2008 16:13:02

Message: 1 of 3

I came across a strange behaviour while computing principal components with the Statistics Toolbox (either princomp or pcacov, doesn't matter).

Background is calculating independent software metrics using PCA. This works quite well, when I'm doing like:

EV Lambda =pcacov(corr(M))
...(compute FL out of EV and Lambda)
C= zscore(M)*EV

leads to nicely uncorrelated C (my independent software metrics). Now the strange thing... I want the principal components better suiting the metrics and use orthogonal rotation like varimax or quartimax with:

RotFL = rotatefactors(FL, 'method', 'varimax', 'normalization', 'off')

This is supposed to be (according to help) an orthogonal operation.
But after another:
CRot= zscore(M)*EVRot
I get correlated C.

It's already visible in RotFL: Computing the angles between each 2 column-vektors (A*B/(|A|*|B|) shows no 90? anymore (as for EV and FL).

I'm lost with this supposingly orthogonal rotation and will appreciate any hints. Thank you.

Subject: strange: correlated principal components after orthogonal rotation

From: Roger Stafford

Date: 23 Oct, 2008 17:20:03

Message: 2 of 3

"Roland Neumann" <software-pca@o2online.de> wrote in message <gdq7qd$p1g$1@fred.mathworks.com>...
> I came across a strange behaviour while computing principal components with the Statistics Toolbox (either princomp or pcacov, doesn't matter).
>
> Background is calculating independent software metrics using PCA. This works quite well, when I'm doing like:
>
> EV Lambda =pcacov(corr(M))
> ...(compute FL out of EV and Lambda)
> C= zscore(M)*EV
>
> leads to nicely uncorrelated C (my independent software metrics). Now the strange thing... I want the principal components better suiting the metrics and use orthogonal rotation like varimax or quartimax with:
>
> RotFL = rotatefactors(FL, 'method', 'varimax', 'normalization', 'off')
>
> This is supposed to be (according to help) an orthogonal operation.
> But after another:
> CRot= zscore(M)*EVRot
> I get correlated C.
>
> It's already visible in RotFL: Computing the angles between each 2 column-vektors (A*B/(|A|*|B|) shows no 90? anymore (as for EV and FL).
>
> I'm lost with this supposingly orthogonal rotation and will appreciate any hints. Thank you.
-------
  Roland, just because a pair of random variables, x and y, are uncorrelated doesn't mean that a rotation of them will yield uncorrelated variables. Let E{x} = E{y} = E(x*y) = 0 so that x and y are uncorrelated. Then rotate them to u = a*x+b*y and v = -b*x+a*y where a^2+b^2 = 1. Then their (cross) covariance will be:

 E{u*v} =
 E{(a*x+b*y)*(-b*x+a*y)} =
 (a^2-b^2)*E{x*y) + a*b*(E{x^2}-E{y^2}) =
 a*b*(E{x^2}-E{y^2})

which will not be zero unless x and y have equal variances. Thus the two quantities u and v are not necessarily uncorrelated.

Roger Stafford

Subject: strange: correlated principal components after orthogonal rotation

From: Roland Neumann

Date: 4 Nov, 2008 09:19:01

Message: 3 of 3

Hello Roger,

Thank you for your fast and precise answer. You helped me alot. When I normalized the Eigenvectors with the Square Root of their Eigenvalues and rotated thereafter, I got uncorrelated Principal components. They all had Variance one.

Now I understand the reason because of your proof.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us