# Solving PCA with correlation matrix of a dataset and its singular value decomposition [duplicate]

Suppose I have a $d \times n$ matrix $\mathbf X$ (each entry point has $d$ dimensions) and after some manipulation of data (i.e. summarizing the data $\mathbf X$) I get its $d \times d$ symmetric, quadratic correlation matrix $\rho$ (defined by Pearson).

Then by SVD definition we know that matrix $\mathbf X$ can be decomposed in three matrices:

$\mathbf X = \mathbf U \mathbf \Sigma \mathbf V^\top$

Hence here is the question:

I want to know if its correct to suppose that

$\mathbf X \mathbf X^\top = \rho$

then doing some algebra we can get:

$\rho = (\mathbf U \mathbf \Sigma \mathbf V^\top)(\mathbf V \mathbf \Sigma \mathbf U^\top)$

so

$\mathbf X \mathbf X^\top = \rho = \mathbf U \mathbf \Sigma^2 \mathbf U^\top$

I want to know if this equivalence is correct, or in which cases is correct? Can anyone give an explanation about it?.

Note I am using correlation Matrix instead of covariance matrix, (we know we can get eigenvalues and eigenvectors from a correlation matrix, and that would solve PCA)

• ?? First you intruduce X as the data matrix, then it somehow becomes the loading matrix. Also, did you mean the size of the data n x d rather than d x n? – ttnphns Jan 29 '13 at 9:28

## 1 Answer

That's right. The diagonal of $\Sigma$ contains the square roots of the eigenvalues of $XX'$. That's true for the original matrix $X$, and for the matrix obtained by scaling the data by column means and standard deviations (which gives you PCA on the correlation matrix).

I'm not sure I understand the last paragraph of your question. The eigenvalues are not the sum of squares of X.

• so, correlation matrix $\rho= \mathbf X \mathbf X^\top$ but why is that? is an equivalence? – edgarmtze Jan 29 '13 at 14:32
• When the columns of $X$ are standardized, $XX^\intercal$ contains the sums of products and cross-products. By the very definition of (sample) correlation, its off-diagonal entries are the correlations among the columns of the original design matrix. – whuber Feb 19 '13 at 21:36