# Eigendecomposition of a Matrix

Learn about eigendecomposition using R, Rcpp, Armadillo, and Eigen.

**Eigendecomposition**, also called **spectral decomposition**, is the factorization of a matrix into a canonical form, where the matrix $𝐴$ is represented in terms of its eigenvalues and eigenvectors.

$A = Q \Lambda Q^{-1}$

- The matrix $𝑄$ is a $𝑛 × 𝑛$ square matrix where the $ith$ column is the eigenvector $𝑞_𝑖$ of $𝐴$.
- The matrix $\Lambda$ is the diagonal matrix where the diagonal elements are the corresponding eigenvalues $\Lambda_{ii} = \lambda_i$.

Only diagonalizable matrices can be factorized in this way.

A (nonzero) vector $𝑣$ of dimension n is an eigenvector of a square $𝑛 \times 𝑛$ matrix $𝐴$ if it satisfies the linear equation:

$A v = \lambda v$

- The $\lambda$ value is a scalar, termed the eigenvalue corresponding to the eigenvector $v$.

Get hands-on with 1200+ tech skills courses.