Calculating Principal Components – PCA – Calculating Eigenvectors as PCs

eigenvalues-eigenvectorslinear algebramatricesprincipal component analysis

I've encountered difficulties while calculating (by hand) the principal components of the following covariance matrix:

$$\Sigma = \begin{bmatrix} 4 & -\sqrt{3}\\ -\sqrt{3} & 2\end{bmatrix}$$

I know how to calculate the eigenvalues ($\lambda_1 = 5$, $\lambda_2 = 1$) but I'm confused after that. I have the solution but I can't reproduce it or do not know what happens there.

So, here is the solution:

Solution PC

My questions are as follows.

  1. How is the solution for each $\lambda$ calculated?

  2. How do they come from the eigenvectors to the principal components? I thought the eigenvectors are already the principal components?

Would be nice if someone can explain me what is going on there, and maybe as detailed as possible and for non-mathematicians 🙂 Cheers!

Best Answer

So after writing down your EVD decomposition that is \begin{equation} \Sigma = UDU^T \end{equation} Notice that $U^T = U^{-1}$ because $\Sigma$ is symmetric, so we have that (as you mention that eigenvalues are) \begin{equation} D = \begin{bmatrix} 1 & 0 \\ 0 & 5 \end{bmatrix} \end{equation} and the second screenshot computes the eigenvectors (which i'm sure you know how to do: \begin{equation} U = \begin{bmatrix} u_1 & u_2 \end{bmatrix} = \frac{1}{2} \begin{bmatrix} -\sqrt{3} & 1 \\ 1 & \sqrt{3} \end{bmatrix} \end{equation} Now let any vector $x = \begin{bmatrix} x_1 & x_2 \end{bmatrix}^T$ be given so \begin{equation} y = \begin{bmatrix} y_1\\y_2 \end{bmatrix} = Ux = \frac{1}{2} \begin{bmatrix} -\sqrt{3} & 1 \\ 1 & \sqrt{3} \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \begin{bmatrix} -\frac{\sqrt{3}}{2}x_1 + \frac{1}{2}x_2\\ \frac{1}{2}x_1 + \frac{\sqrt{3}}{2} x_2 \end{bmatrix} \end{equation}