Matrix Decompositions
A matrix decomposition or matrix factorisation expresses a matrix as a product of matrices with special structure, such as triangular, diagonal or orthogonal matrices, so that properties of can be read off the factors and systems of linear equations involving can be solved by simpler steps. The diagonalisation of a non-defective square matrix is one such decomposition.
The spectral theorem states that a real symmetric matrix has real eigenvalues repeated according to algebraic multiplicity, and an eigen-basis of that is an orthonormal set. Collecting the orthonormal eigenvectors as the columns of gives an orthogonal matrix and the spectral decomposition
where is the diagonal matrix of eigenvalues. A real symmetric matrix is therefore positive definite if and only if all of its eigenvalues are positive, and positive semi-definite if and only if all of its eigenvalues are non-negative. The complex analogue states that a Hermitian matrix has real eigenvalues and a decomposition with unitary.
Let be a square matrix. The leading principal sub-matrix of is formed from its first rows and columns, and the leading principal minor of order is An LU decomposition of is a factorisation
where is a lower triangular matrix with diagonal elements equal to one and is an upper triangular matrix. If is invertible then an LU decomposition exists if and only if every leading principal minor is non-zero, and it is then unique. The factors are produced by Gaussian elimination: is the result of eliminating the elements below the diagonal column by column using row operations and records the multipliers used.
A permutation matrix is a matrix obtained by reordering the rows of the identity matrix so that reorders the rows of in the same way. Permutation matrices are orthogonal, so Every square matrix has a PLU decomposition
for some permutation matrix obtained by swapping rows during Gaussian elimination so that each diagonal element used for elimination is non-zero. The determinant follows from the factors, where and the system is solved by the two triangular systems and by forward and back substitution.
Let be a matrix with rank A rank factorisation of is a factorisation
where and both have rank Every matrix of rank has a rank factorisation: the columns of can be taken to be any basis of the column space of and the columns of are then the coordinates of the columns of in that basis. The factorisation is not unique, since for any invertible and is the smallest inner dimension for which factorises as a product of two matrices.
Let be a real symmetric positive definite matrix. The Cholesky decomposition of is the factorisation
where is a lower triangular matrix with positive diagonal elements. The Cholesky decomposition exists and is unique if and only if is symmetric positive definite, so attempting to compute it is a test for positive definiteness. For a Hermitian positive definite matrix the decomposition is The elements of are computed column by column from
the determinant is and acts as a matrix square root of A symmetric positive semi-definite matrix also factorises as with non-negative diagonal elements, but then not necessarily uniquely.
Let be a real matrix with A QR decomposition of is a factorisation
where has orthonormal columns, so is orthogonal when and semi-orthogonal when and is an upper triangular matrix. This is the thin QR decomposition. The full QR decomposition extends to an orthogonal matrix in by appending further orthonormal columns and to a matrix in by appending rows of zeros. Every real matrix has a QR decomposition. If has rank then the thin QR decomposition with positive diagonal elements of is unique and is given by Gram-Schmidt orthonormalisation of the columns of the columns of are the orthonormalised vectors and
so that The columns of are an orthonormal basis of the column space of The QR decomposition solves the least squares problem of minimising over through the triangular system The complex analogue has unitary and uses the conjugate transpose.
Let be a real matrix. The matrix is symmetric positive semi-definite, since so by the spectral theorem its eigenvalues are real and non-negative. The singular values of are the square roots of these eigenvalues in decreasing order.
The matrices and share their non-zero eigenvalues, so has singular values and the number of non-zero singular values is the rank of
The singular value decomposition (SVD) of is the factorisation
where and are orthogonal matrices and has the singular values along its diagonal and zeros elsewhere. The columns of are the left singular vectors and the columns of are the right singular vectors of Every real matrix has a singular value decomposition, and the singular values are unique although and are not. Multiplying out gives
so the right singular vectors are orthonormal eigenvectors of the left singular vectors are orthonormal eigenvectors of and the two are linked by
If is symmetric positive semi-definite then its singular value decomposition coincides with its spectral decomposition. The complex analogue has unitary and and uses the conjugate transpose.
Let have rank The thin singular value decomposition keeps only the non-zero singular values and the corresponding singular vectors, and and expresses as a sum of rank-one matrices.
The left singular vectors are an orthonormal basis of the column space of and the right singular vectors are an orthonormal basis of the kernel of the set of with
The Frobenius norm of a matrix is the Euclidean length of its elements, which equals the Euclidean length of its singular values.
The Eckart–Young theorem states that for the matrix of rank at most that is closest to in Frobenius norm is the truncated singular value decomposition that keeps the largest singular values.
This low-rank approximation underlies principal components analysis and data compression.
Let have singular value decomposition and let be the matrix with in the diagonal positions where has non-zero and zeros elsewhere. The Moore–Penrose pseudo-inverse of is
The pseudo-inverse is the unique matrix satisfying the four conditions
and generalises the matrix inverse to singular and non-square matrices: if is invertible then if has rank then and if has rank then The vector is the solution of the least squares problem of minimising that has the smallest Euclidean length and is the matrix that projects orthogonally onto the column space of