Principal Component Analysis

Say the reference cube is

,

where xi's are the flattened images, then the covariance matrix for this cube is

,

which is a Hermitian matrix with real eigenvalues (actually, it is real symmetric), since

.

Then the spectral decomposition of the covariance matrix becomes

,

where D = diag{λ1, λ2, ..., λn} is consisted of the eigenvalues, and Q is a real orthogonal matrix with the columns as the corresponding eigenvectors.

Assuming the diagonal entries follow λiλi+1, and rewrite the spectral decomposition as

,

then taking look at the components in the first square bracket, we get

.

The rows of QTX are the orthogonal principal components! Normalize the rows by dividing the square root of λi, then we can get an orthonormal basis.

(Last revised on Oct 19, 2015)