Tutorials › Statistical Theory I - Probability and Distribution Theory › Simultaneous Diagonalization of Commuting Quadratic Forms

Gaussian Quadratic Forms · Tutorial 767 of 994

Simultaneous Diagonalization of Commuting Quadratic Forms

Use commutation to find a shared orthonormal basis, then read the joint structure of Gaussian quadratic forms from their common coordinates.

Advanced 10 min read

What You'll Learn

  • State and prove the simultaneous diagonalization criterion for a finite family of real symmetric matrices.
  • Construct a common orthonormal basis from commuting matrices.
  • Express several centered Gaussian quadratic forms in the same independent normal coordinates.
  • Derive their means and pairwise covariances from their shared eigenvalues.
  • Distinguish simultaneous diagonalization from independence of the quadratic forms.
  • Apply the representation to a shifted Gaussian vector and to disjoint-coordinate forms.

Why a Common Basis Matters

A single symmetric matrix can be diagonalized by choosing coordinates along its eigenvectors. When several quadratic forms are being studied together, diagonalizing each matrix separately is not enough: the resulting coordinates may differ from one form to another. The key question is whether one orthonormal coordinate system diagonalizes all the matrices at once.

Commutation provides the answer. If a finite collection of real symmetric matrices commutes pairwise, they have a common orthonormal eigenbasis. For Gaussian vectors, this shared basis is especially useful because an orthogonal change of coordinates preserves a standard multivariate normal distribution. Consequently, all the quadratic forms can be written using the same independent standard normal coordinates. The shared coordinates also make clear why simultaneous diagonalization does not, by itself, imply independence of the forms.

Simultaneous Diagonalization

Definition: A finite family of square matrices \(A_1,\ldots,A_k\) is simultaneously orthogonally diagonalizable if there is an orthogonal matrix \(U\), meaning \(U'U=I\), such that every \(U'A_rU\) is diagonal. The matrices commute pairwise if \(A_rA_s=A_sA_r\) for every pair \(r,s\).
Theorem: A finite family of real symmetric matrices is simultaneously orthogonally diagonalizable if and only if its members commute pairwise.

For the forward direction, suppose \(U'A_rU=D_r\) and \(U'A_sU=D_s\) are diagonal. Diagonal matrices commute, so \(D_rD_s=D_sD_r\). Since \(UU'=I\), \(A_rA_s=UD_rD_sU'=UD_sD_rU'=A_sA_r\).

For the reverse direction, use induction on the number \(k\) of matrices. The case \(k=1\) is the spectral theorem for real symmetric matrices. Suppose the result holds for \(k-1\) pairwise commuting real symmetric matrices, and consider \(A_1,\ldots,A_k\). By the spectral theorem, the space is an orthogonal direct sum of the eigenspaces \(E_\lambda\) of \(A_1\). Each \(E_\lambda\) is invariant under every \(A_r\), \(r\geq 2\): if \(v\in E_\lambda\), then \(A_1v=\lambda v\), and commutation gives \(A_1(A_rv)=A_r(A_1v)=\lambda A_rv\), so \(A_rv\in E_\lambda\).

On each \(E_\lambda\), the restrictions of \(A_2,\ldots,A_k\) are symmetric and commute pairwise. By the induction hypothesis, they have a common orthonormal eigenbasis on that eigenspace. Combining these bases across the mutually orthogonal eigenspaces gives an orthonormal basis of the full space. Its vectors are eigenvectors of \(A_1\) and of every other \(A_r\), so it diagonalizes the whole family. Thus pairwise commutation is sufficient as well. \(\square\)

What the Shared Basis Does to Gaussian Forms

For a vector \(z\in\mathbb{R}^p\), the quadratic form associated with a symmetric matrix \(A\) is \(z'Az\). Suppose \(A_1,\ldots,A_k\) commute pairwise and are real symmetric. Choose a common orthogonal diagonalizer \(U\), and write \(U'A_rU=\operatorname{diag}(\lambda_{r1},\ldots,\lambda_{rp})\). For \(Z\sim N_p(0,I)\), define \(Y=U'Z\). Orthogonal invariance gives \(Y\sim N_p(0,I)\), whose coordinates \(Y_1,\ldots,Y_p\) are independent standard normal random variables. Substitution then gives the joint representation

$$ Z'A_rZ =Y'(U'A_rU)Y =\sum_{j=1}^p \lambda_{rj}Y_j^2, \qquad r=1,\ldots,k. $$

The same \(Y_j\)'s appear in every form. This is the central feature of the joint representation: each form has its own eigenvalues, but the random coordinates are shared. The statement does not say that the forms are independent.

The representation also yields exact first and second moments. Since a standard normal variable has \(E[Y_j^2]=1\) and \(\operatorname{Var}(Y_j^2)=2\), independence of the coordinates gives

$$ E[Z'A_rZ]=\sum_{j=1}^p\lambda_{rj}=\operatorname{tr}(A_r), \qquad \operatorname{Cov}(Z'A_rZ,Z'A_sZ) =2\sum_{j=1}^p\lambda_{rj}\lambda_{sj} =2\operatorname{tr}(A_rA_s). $$

For the covariance, terms with different coordinate indices have zero covariance, while the \(j\)th shared coordinate contributes \(\lambda_{rj}\lambda_{sj}\operatorname{Var}(Y_j^2)=2\lambda_{rj}\lambda_{sj}\). The trace identity follows because both matrices are diagonal in the common basis.

Worked Example: Two Commuting Forms in a Rotated Basis

Let \(U=\frac{1}{\sqrt{2}}\begin{pmatrix}1&1\\-1&1\end{pmatrix}\), and define \(A=U\operatorname{diag}(1,3)U'\) and \(B=U\operatorname{diag}(2,0)U'\). Direct multiplication gives

$$ A=\begin{pmatrix}2&1\\1&2\end{pmatrix}, \qquad B=\begin{pmatrix}1&-1\\-1&1\end{pmatrix}. $$

The matrix \(U\) is orthogonal, and the diagonal representations show that \(A\) and \(B\) commute. Let \(Z\sim N_2(0,I)\) and \(Y=U'Z\). The coordinates \(Y_1,Y_2\) are independent standard normal variables. Therefore

$$ Q_A=Z'AZ=Y_1^2+3Y_2^2, \qquad Q_B=Z'BZ=2Y_1^2. $$

Their expectations are \(E[Q_A]=1+3=4\) and \(E[Q_B]=2\). Their covariance is \(\operatorname{Cov}(Y_1^2+3Y_2^2,2Y_1^2)=2\operatorname{Var}(Y_1^2)=2(2)=4\). The trace formula agrees: \(AB\) has eigenvalues \(2\) and \(0\), so \(2\operatorname{tr}(AB)=2(2)=4\). The nonzero covariance confirms that these commuting forms are not independent.

Independence Depends on Which Coordinates Are Used

The common-basis representation separates the question of diagonalization from the question of independence. If two forms involve disjoint sets of the independent coordinates \(Y_1,\ldots,Y_p\), then they are independent: each is a function of a different group of independent random variables. If they share coordinates with nonzero coefficients, they need not be independent. The preceding example shares \(Y_1^2\), and its covariance is nonzero.

A useful special case is when the diagonal matrices have disjoint nonzero coordinate positions. In that case their forms are functions of disjoint coordinate groups. Commutation alone does not impose this disjointness; it only ensures that a shared orthonormal basis exists.

Worked Example: Disjoint Coordinates Give Independent Forms

Let \(Z\sim N_3(0,I)\), with \(A=\operatorname{diag}(1,1,0)\) and \(B=\operatorname{diag}(0,0,4)\). These matrices are already diagonal in the same basis, and

$$ Q_A=Z_1^2+Z_2^2, \qquad Q_B=4Z_3^2. $$

The first form is a function only of \((Z_1,Z_2)\); the second is a function only of \(Z_3\). These coordinate groups are independent, so \(Q_A\) and \(Q_B\) are independent. Their means are \(E[Q_A]=1+1=2\) and \(E[Q_B]=4\). Their covariance is zero, also as predicted by \(2\operatorname{tr}(AB)=0\). Here independence follows from the disjoint-coordinate representation, not merely from the fact that the covariance is zero.

Shifted Gaussian Vectors

The same coordinates work when the Gaussian vector has a nonzero mean. If \(Z\sim N_p(m,I)\), then \(Y=U'Z\sim N_p(U'm,I)\), with independent coordinates. Writing \(\nu=U'm\), each form becomes

$$ Z'A_rZ=\sum_{j=1}^p\lambda_{rj}Y_j^2, \qquad Y_j\sim N(\nu_j,1)\ \text{independently}. $$

The coefficients are still the eigenvalues in the common basis; the shift changes the coordinate distributions, not the diagonalization. The shared coordinates again determine how the forms are related.

Worked Example: A Common Basis With a Nonzero Mean

Use the matrices \(A\) and \(B\) from the first example, but let \(Z\sim N_2(m,I)\) with \(m=(1,2)'\). In the common basis,

$$ Y_1=\frac{Z_1-Z_2}{\sqrt{2}}, \qquad Y_2=\frac{Z_1+Z_2}{\sqrt{2}}, \qquad E[Y_1]=-\frac{1}{\sqrt{2}}, \qquad E[Y_2]=\frac{3}{\sqrt{2}}. $$

The coordinates remain independent and each has variance \(1\), so \(E[Y_1^2]=1+(-1/\sqrt{2})^2=3/2\) and \(E[Y_2^2]=1+(3/\sqrt{2})^2=11/2\). Thus

$$ E[Z'AZ]=\frac{3}{2}+3\left(\frac{11}{2}\right)=18, \qquad E[Z'BZ]=2\left(\frac{3}{2}\right)=3. $$

These calculations can be checked directly using \(E[Z'AZ]=\operatorname{tr}(A)+m'Am\). Here \(\operatorname{tr}(A)=4\), \(Am=(4,5)'\), and \(m'Am=(1,2)(4,5)'=14\), giving \(18\). Similarly, \(\operatorname{tr}(B)=2\), \(Bm=(-1,1)'\), and \(m'Bm=1\), giving \(3\).

Using the Result With a General Covariance Matrix

If \(X\sim N_p(\mu,\Sigma)\) with positive definite covariance matrix \(\Sigma\), set \(Z=\Sigma^{-1/2}(X-\mu)\). Then \(Z\sim N_p(0,I)\). For centered forms in \(X-\mu\),

$$ (X-\mu)'A_r(X-\mu)=Z'B_rZ, \qquad B_r=\Sigma^{1/2}A_r\Sigma^{1/2}. $$

Each \(B_r\) is real symmetric when \(A_r\) is real symmetric. The common-basis result applies if these whitened matrices \(B_r\) commute pairwise. Commutation of the original \(A_r\)'s alone does not generally establish that condition when \(\Sigma\) is not the identity. If the forms are uncentered, \(X'A_rX\), substituting \(X=\mu+\Sigma^{1/2}Z\) also produces linear terms in \(Z\); diagonalizing the quadratic parts does not remove those terms automatically.

Common Pitfalls and Practical Meaning

  • Assuming separate diagonalizations are enough. The eigenvectors must be shared. Pairwise commutation is the condition that guarantees a common orthonormal basis for real symmetric matrices.
  • Confusing simultaneous diagonalization with independence. A common basis expresses all forms using the same independent normal coordinates; overlapping nonzero coefficients can leave dependence, as the first example shows.
  • Changing the matrices but not the random vector. If \(U'A_rU\) is used to diagonalize the matrices, the corresponding coordinates in the form are \(Y=U'Z\). This keeps the quadratic-form identity exact.
  • Applying the identity without checking the covariance. For a nonstandard Gaussian covariance, first account for the covariance by whitening. The relevant matrices for centered forms are \(\Sigma^{1/2}A_r\Sigma^{1/2}\).

The practical payoff is a shared coordinate description of several forms. It reveals their individual eigenvalue weights, which normal coordinates contribute to each form, and where dependence can arise. Those structural facts are often more informative than analyzing each quadratic form in isolation.

Check Your Understanding

Work through these questions using the common-basis representation.

  1. Why does pairwise commutation suffice for a common orthonormal eigenbasis when all the matrices are real symmetric?
  2. If \(U'AU=\operatorname{diag}(2,0)\) and \(U'BU=\operatorname{diag}(0,5)\), what coordinate sets determine the two centered standard-Gaussian forms, and why are they independent?
  3. For commuting matrices with common-basis eigenvalues \(\lambda_{rj}\) and \(\lambda_{sj}\), express the covariance of their centered standard-Gaussian forms using those eigenvalues.
  4. Can two commuting symmetric matrices give dependent Gaussian quadratic forms? Explain using shared coordinates or covariance.
  5. For centered forms in \(X\sim N_p(\mu,\Sigma)\), which matrices must commute to use this simultaneous diagonalization argument after whitening?