Tutorials › Multivariate Statistics (Graduate) › Symmetric Matrix Square Roots

Matrix Foundations for Inference · Tutorial 7 of 975

Symmetric Matrix Square Roots

Use eigenvalues and orthonormal eigenvectors to construct symmetric matrix square roots, verify their properties, and decide whether an inverse square root exists.

Beginner 10 min read

What You'll Learn

  • Define a symmetric positive semidefinite square root of a matrix.
  • Construct a square root by taking square roots of the eigenvalues.
  • Establish when a symmetric positive semidefinite square root exists and why it is unique.
  • Construct an ordinary inverse square root for a positive definite matrix.
  • Distinguish a singular matrix’s square root from an ordinary inverse square root.
  • Check square-root and inverse-square-root calculations in concrete examples.

Why Take a Matrix Square Root?

A scalar square root rescales a number in a way that reverses squaring. For matrices, the same idea is useful when a calculation calls for a matrix whose product with itself is a given matrix. In multivariate statistics, such transformations arise in operations involving covariance matrices, including rescaling directions that have different variances. The symmetric square root is especially useful because it treats the eigendirections of a symmetric matrix directly and does not depend on a particular triangular factorization.

This tutorial focuses on symmetric real matrices. The key tool is the spectral decomposition: for a real symmetric \(p\times p\) matrix \(A\), there is an orthogonal matrix \(Q\) and a diagonal matrix \(\Lambda\) such that \(A=Q\Lambda Q^{\mathsf T}\). The columns of \(Q\) are orthonormal eigenvectors, and the diagonal entries of \(\Lambda\) are the corresponding real eigenvalues. We use \(Q^{\mathsf T}Q=I\).

Definition: A symmetric positive semidefinite square root of a symmetric matrix \(A\) is a symmetric positive semidefinite matrix \(B\) such that \(B^2=BB=A\). It is commonly denoted \(A^{1/2}\) when it exists. Positive semidefinite means \(x^{\mathsf T}Bx\ge 0\) for every vector \(x\).

Constructing the Square Root from Eigenvalues

Suppose \(A=Q\Lambda Q^{\mathsf T}\), where \(\Lambda=\operatorname{diag}(\lambda_1,\ldots,\lambda_p)\). If every \(\lambda_i\) is nonnegative, define

$$ A^{1/2} = Q\operatorname{diag}(\sqrt{\lambda_1},\ldots,\sqrt{\lambda_p})Q^{\mathsf T}. $$

The construction keeps the same orthonormal eigenvectors and replaces each eigenvalue by its nonnegative scalar square root. In particular, a zero eigenvalue remains zero. The resulting matrix is symmetric because its middle diagonal matrix is symmetric, and it is positive semidefinite because for any \(x\),

$$ x^{\mathsf T}A^{1/2}x = (Q^{\mathsf T}x)^{\mathsf T} \operatorname{diag}(\sqrt{\lambda_1},\ldots,\sqrt{\lambda_p}) (Q^{\mathsf T}x) \ge 0. $$

Squaring the construction recovers \(A\): the orthogonality identity \(Q^{\mathsf T}Q=I\) makes the two adjacent copies of \(Q\) cancel, and \((\sqrt{\lambda_i})^2=\lambda_i\) for each eigenvalue.

Worked Example: A Nondiagonal Positive Definite Matrix

Consider

$$ A= \begin{pmatrix} 2&1\\ 1&2 \end{pmatrix}. $$

The unit eigenvectors \(q_1=(1,1)^{\mathsf T}/\sqrt{2}\) and \(q_2=(1,-1)^{\mathsf T}/\sqrt{2}\) have eigenvalues \(3\) and \(1\), respectively. Thus \(Q=(q_1\ q_2)\) and \(\Lambda=\operatorname{diag}(3,1)\), so

$$ A^{1/2} = Q\begin{pmatrix}\sqrt{3}&0\\0&1\end{pmatrix}Q^{\mathsf T} = \frac12 \begin{pmatrix} \sqrt{3}+1&\sqrt{3}-1\\ \sqrt{3}-1&\sqrt{3}+1 \end{pmatrix}. $$

To check the result directly, set \(a=(\sqrt{3}+1)/2\) and \(b=(\sqrt{3}-1)/2\). The proposed root is \(\begin{pmatrix}a&b\\b&a\end{pmatrix}\), whose square has diagonal entries \(a^2+b^2=2\) and off-diagonal entries \(2ab=1\). Therefore its square is exactly \(A\). Its eigenvalues are \(\sqrt{3}\) and \(1\), both positive, so it is positive definite as well as symmetric.

Theorem: A real symmetric matrix \(A\) has a symmetric positive semidefinite square root if and only if \(A\) is positive semidefinite. When it exists, this square root is unique.

Proof. First suppose \(A\) is positive semidefinite. By the spectral theorem, \(A=Q\Lambda Q^{\mathsf T}\) with real eigenvalues \(\lambda_i\). For an eigenvector \(q_i\), positive semidefiniteness gives \(\lambda_i=q_i^{\mathsf T}Aq_i\ge 0\), since \(q_i\) is a unit vector. The construction above is therefore defined, is symmetric and positive semidefinite, and squares to \(A\).

Conversely, suppose \(A=B^2\) for a symmetric positive semidefinite \(B\). For every \(x\),

$$ x^{\mathsf T}Ax=x^{\mathsf T}B^2x=(Bx)^{\mathsf T}(Bx)\ge 0. $$

Thus \(A\) is positive semidefinite.

It remains to prove uniqueness. Let \(B\) be any symmetric positive semidefinite matrix satisfying \(B^2=A\). Then \(AB=B^2B=B^3=BB^2=BA\), so \(A\) and \(B\) commute. For each eigenvalue \(\lambda\) of \(A\), let \(E_\lambda=\{x:Ax=\lambda x\}\) be its eigenspace. If \(x\in E_\lambda\), then \(A(Bx)=B(Ax)=\lambda Bx\); hence \(B\) maps \(E_\lambda\) into itself. The restriction of \(B\) to this space is symmetric and positive semidefinite, and its square is \(\lambda I\). By the spectral theorem applied to this restriction, each of its eigenvalues \(\beta\) is nonnegative and satisfies \(\beta^2=\lambda\). Therefore every such \(\beta\) equals \(\sqrt{\lambda}\), and \(B\) acts as \(\sqrt{\lambda}I\) on \(E_\lambda\). This holds on every eigenspace of \(A\), so \(B\) must equal the spectral construction above. \(\square\)

Singular Matrices and Inverse Square Roots

The square-root construction allows zero eigenvalues, so it applies to positive semidefinite matrices that are singular as well as to positive definite ones. An ordinary inverse square root has a stricter existence condition: the matrix must be positive definite. For a positive definite \(A=Q\Lambda Q^{\mathsf T}\), all eigenvalues are strictly positive, and the inverse of its symmetric square root is

$$ A^{-1/2} = \left(A^{1/2}\right)^{-1} = Q\operatorname{diag}\left(\frac{1}{\sqrt{\lambda_1}},\ldots, \frac{1}{\sqrt{\lambda_p}}\right)Q^{\mathsf T}. $$

Indeed, multiplying \(A^{-1/2}\) by \(A^{1/2}\) gives \(QIQ^{\mathsf T}=I\). If a positive semidefinite matrix has a zero eigenvalue, its square root has a zero eigenvalue too and cannot have an ordinary inverse. More generally, a singular matrix itself cannot have an ordinary inverse. One can still form a matrix by taking reciprocal square roots on the positive-eigenvalue directions and leaving zeros on the zero-eigenvalue directions; that construction is not an ordinary inverse square root, since it does not invert the action on the null space.

Worked Example: A Singular Positive Semidefinite Matrix

Let

$$ A= \begin{pmatrix} 1&1&0\\ 1&1&0\\ 0&0&0 \end{pmatrix}. $$

The unit vector \(q_1=(1,1,0)^{\mathsf T}/\sqrt{2}\) is an eigenvector with eigenvalue \(2\). The orthogonal vectors \(q_2=(1,-1,0)^{\mathsf T}/\sqrt{2}\) and \(q_3=(0,0,1)^{\mathsf T}\) have eigenvalue \(0\). Hence the eigenvalues are \(2,0,0\), all nonnegative, and the matrix is positive semidefinite. Taking their nonnegative square roots gives

$$ A^{1/2} = \begin{pmatrix} 1/\sqrt{2}&1/\sqrt{2}&0\\ 1/\sqrt{2}&1/\sqrt{2}&0\\ 0&0&0 \end{pmatrix}. $$

The top-left \(2\times2\) block of this root squares to \(\begin{pmatrix}1&1\\1&1\end{pmatrix}\), and the last row and column remain zero. Thus \((A^{1/2})^2=A\). However, \(A^{1/2}\) has zero eigenvalues and is singular, so it has no ordinary inverse. The inverse square root \(A^{-1/2}\), in the ordinary sense, does not exist.

Theorem: A symmetric positive semidefinite matrix \(A\) has an ordinary inverse square root \(A^{-1/2}=(A^{1/2})^{-1}\) if and only if \(A\) is positive definite. Its eigenvalues are the reciprocals of the square roots of the eigenvalues of \(A\).

Proof. If \(A\) is positive definite, its spectral decomposition has \(\lambda_i>0\) for every \(i\). The displayed spectral construction for \(A^{-1/2}\) is then defined, and its product with \(A^{1/2}\) is \(QIQ^{\mathsf T}=I\). Thus it is the ordinary inverse of \(A^{1/2}\). Conversely, if \(A\) is positive semidefinite but not positive definite, its spectral decomposition includes at least one zero eigenvalue. The corresponding eigenvalue of \(A^{1/2}\) is also zero, so \(A^{1/2}\) is singular and has no ordinary inverse. Therefore an ordinary inverse square root exists exactly in the positive definite case. \(\square\)

Worked Example: Constructing and Checking an Inverse Square Root

Take the matrix with orthonormal eigenvectors \(q_1=(1,1)^{\mathsf T}/\sqrt{2}\) and \(q_2=(1,-1)^{\mathsf T}/\sqrt{2}\), and eigenvalues \(4\) and \(1\). In matrix form,

$$ A=Q\begin{pmatrix}4&0\\0&1\end{pmatrix}Q^{\mathsf T} = \begin{pmatrix} 5/2&3/2\\ 3/2&5/2 \end{pmatrix}. $$

Both eigenvalues are positive, so \(A\) is positive definite. Taking square roots and reciprocal square roots gives

$$ A^{1/2} = Q\begin{pmatrix}2&0\\0&1\end{pmatrix}Q^{\mathsf T} = \begin{pmatrix} 3/2&1/2\\ 1/2&3/2 \end{pmatrix}, \qquad A^{-1/2} = Q\begin{pmatrix}1/2&0\\0&1\end{pmatrix}Q^{\mathsf T} = \begin{pmatrix} 3/4&-1/4\\ -1/4&3/4 \end{pmatrix}. $$

Multiplying the two diagonal forms in the eigenbasis gives \(Q\operatorname{diag}(1,1)Q^{\mathsf T}=I\), so the proposed inverse square root is indeed the inverse of \(A^{1/2}\). A direct check also gives

$$ (A^{-1/2})^2 = \begin{pmatrix} 5/8&-3/8\\ -3/8&5/8 \end{pmatrix} = Q\begin{pmatrix}1/4&0\\0&1\end{pmatrix}Q^{\mathsf T} =A^{-1}. $$

Thus the inverse square root squares to the inverse matrix, as its notation indicates.

Common Mistake and Practical Checks

A common mistake is to treat every positive semidefinite matrix as invertible because its eigenvalues are nonnegative. Nonnegative is enough for a symmetric positive semidefinite square root, but not for an ordinary inverse square root: a single zero eigenvalue prevents inversion. The correction is to check whether eigenvalues are all nonnegative or all strictly positive, depending on which construction is needed.

A second mistake is to take square roots of the entries of a matrix separately. Matrix multiplication mixes entries, so entrywise square roots generally do not produce a matrix whose square is the original matrix. The construction is performed on eigenvalues in an orthonormal eigenbasis, then transformed back using \(Q\) and \(Q^{\mathsf T}\).

When checking a proposed result, verify the defining matrix equation, symmetry, and the required definiteness. For \(A^{1/2}\), check \((A^{1/2})^2=A\) and that its eigenvalues are nonnegative. For \(A^{-1/2}\), check that the eigenvalues of \(A\) are strictly positive and that \((A^{-1/2})^2=A^{-1}\), or equivalently that \(A^{-1/2}A^{1/2}=I\).

Check Your Understanding

Use the spectral construction and the existence conditions to answer the following.

  1. What condition on the eigenvalues of a real symmetric matrix guarantees a symmetric positive semidefinite square root?
  2. Why does the spectral construction leave a zero eigenvalue at zero rather than replace it by a positive number?
  3. A positive semidefinite matrix has eigenvalues \(5,2,0\). Does its symmetric positive semidefinite square root exist? Does its ordinary inverse square root exist? Explain.
  4. For a positive definite matrix with eigenvalues \(9\) and \(4\), what are the eigenvalues of its symmetric square root and inverse square root?
  5. Why is taking square roots of the entries not the general method for finding a matrix square root?
Clinical Biostats