# Properties of spectral decomposition

Spectral Decomposition

Let $\mathbf{A}$ be a $k\times k$ positive definite matrix with the spectral decomposition $\mathbf{A}=\sum_{i=1}^{k}\lambda_{i}\mathbf{e}_{i}\mathbf{e}_{i}^{\prime}$. Let the normalized eigenvectors be the columns of another matrix $\mathbf{P}=\begin{bmatrix}\mathbf{e}_{1}, & \mathbf{e}_{2}, & \ldots, & \mathbf{e}_{k}\end{bmatrix}$. Then

$\mathbf{A}=\sum_{i=1}^{k}\lambda_{i}\mathbf{e}_{i}\mathbf{e}_{i}^{\prime}=\mathbf{P}\Lambda\mathbf{P}^{\prime}$

where $\mathbf{P}\mathbf{P}^{\prime}=\mathbf{P}^{\prime}\mathbf{P}=\mathbf{I}$ and $\Lambda$ is the diagonal matrix

$\Lambda=\begin{bmatrix}\lambda_{1} & 0 & \ldots & 0\\ 0 & \lambda_{2} & \ldots & 0\\ \vdots & \vdots & \ddots & \vdots\\ 0 & 0 & \ldots & \lambda_{k} \end{bmatrix}\textrm{ with }\lambda_{i}>0.$

R Code

A <- matrix(data=c(1, 0, 1, 3), nrow=2, ncol=2, byrow=TRUE)
eigen(A)
eigen(A)$vectors %*% diag(eigen(A)$values) %*% t(eigen(A)$vectors)  Output $values
[1] 3 1