# Calculating Variance Explained from PCA Loadings

I have a return history for a universe of risky assets and I've run a principal component algorithm and obtained a loadings matrix (num_factors by num_assets) for the first 5 factors.

I have a portfolio as well (a subset of the above universe) with weights w for each of the assets. This portfolio has a variance \sigma^2. How do I figure out the percentage of the variance in the portfolio that comes from factor 1?

• The algorithms usually give it to you as one of the outputs. – John May 6 '14 at 0:12

## 1 Answer

PCA gives you a decomposition of the covariance matrix of the form $$\Sigma = V \Lambda V^T$$ where $\Lambda$ is diagonal with the eigenvalues in the diagonal. Your portfolio variance is $$w^T \Sigma w = (V^T w )^T \Lambda (V^T w)$$ On the other hand if you take your return matrix $R$ and define $$F = V^T R$$ then the covariance matrix of these so called principle portfolios is $\Lambda$. You find this here by Meucci.

In fact he writes $V^{-1} R$ for the return of principle portfolios and defines the weights $w^* = V^{-1} w$ for the weight of the original portfolio on the principle portfolios.

He then defines $v_n = (w^*)^2 \lambda_n^2$ for the contribution of the n-th principle portfolio to the portfolio variance. If you relate this to the total volatility of the portfolio then you are done. Note that $V$ is orthogonal which means that $V^{-1} = V^T$.

I recommend to read the following white paper or this blog entry or this to get more details.

• Thanks Richard. The links were especially helpful. Using the links I was able to determine that you can get the $v_n$ above using $v_n = (Lw)^2$ where $L$ is the loadings matrix and the results is the same as using $(w^*)^2 \lambda_n^2$. – rhaskett May 9 '14 at 18:01