22
Sep 18

## Applications of the diagonal representation IV

Principal component analysis is a general method based on diagonalization of the variance matrix. We consider it in a financial context. The variance matrix measures riskiness of the portfolio.  We want to see which stocks contribute most to the portfolio risk. The surprise is that the answer is given not in terms of the vector of returns but in terms of its linear transformation.

### 8. Principal component analysis (PCA)

Let $R$ be a column-vector of returns on $p$ stocks with the variance matrix $V(R)=E(R-ER)(R-ER)^{T}$. The idea is to find an orthogonal matrix $W$ such that $W^{-1}V(R)W=D$ is a diagonal matrix $D=diag[\lambda_1,...,\lambda_p]$ with $\lambda_1\geq...\geq\lambda_p.$

With such a matrix, instead of $R$ we can consider its transformation $Y=W^{-1}R$ for which

$V(Y)=W^{-1}V(R)(W^{-1})^T=W^{-1}V(R)W=D.$

We know that $V(Y)$ has variances $V(Y_1),...,V(Y_p)$ on the main diagonal. It follows that $V(Y_i)=\lambda_i$ for all $i.$ Variance is a measure of riskiness. Thus, the transformed variables $Y_1,...,Y_p$ are put in the order of declining risk. What follows is the realization of this idea using sample data.

In a sampling context, all population means should be replaced by their sample counterparts. Let $R^{(t)}$ be a $p\times 1$ vector of observations on $R$ at time $t.$ These observations are put side by side into a matrix $\mathbb{R}=(R^{(1)},...,R^{(n)})$ where $n$ is the number of moments in time. The population mean $ER$ is estimated by the sample mean

$\bar{\mathbb{R}}=\frac{1}{n}\sum_{t=1}^nR^{(t)}.$

The variance matrix $V(R)$ is estimated by

$\hat{V}=\frac{1}{n-1}(\mathbb{R}-\bar{\mathbb{R}}l)(\mathbb{R}-\bar{\mathbb{R}}l)^T$

where $l$ is a $1\times n$ vector of ones. It is this matrix that is diagonalized: $W^{-1}\hat{V}W=D.$

In general, the eigenvalues in $D$ are not ordered. Ordering them and at the same time changing places of the rows of $W^{-1}$ correspondingly we get a new orthogonal matrix $W_1$ (this requires a small proof) such that the eigenvalues in $W_1^{-1}\hat{V}W_1=D_1$ will be ordered. There is a lot more to say about the method and its applications.