Tutorials › Multivariate Statistics (Graduate) › Whitening and the Singular Value Decomposition

Canonical Correlation Analysis · Tutorial 385 of 975

Whitening and the Singular Value Decomposition

Learn how covariance whitening and the singular value decomposition reveal the canonical correlations and their connection to the generalized eigenvalue equations.

Intermediate 10 min read

What You'll Learn

  • Define symmetric covariance whitening for two multivariate variable sets
  • Transform canonical correlation into a unit-vector bilinear optimization
  • Show why singular values of the whitened cross-covariance are canonical correlations
  • Connect the singular vectors to the generalized eigenvalue equations
  • Work examples with nonidentity covariance matrices and rectangular cross-covariance matrices
  • Recognize when singular values are bounded by one and why whitening is not ordinary rescaling

Why Whitening Clarifies Canonical Correlation

Canonical correlation compares linear combinations of two variable sets. The within-set covariance matrices complicate the comparison: a coefficient vector with a large numerical size need not produce a score with large variance, and different directions within a set may have different scales. Whitening removes those within-set scales. After whitening, each set has identity covariance, and the association between the sets is represented by a single cross-covariance matrix.

The singular value decomposition (SVD) of that matrix gives a direct description of the canonical correlations. This is more than a computational convenience: it is the ordinary Euclidean geometry underlying the generalized eigenvalue equations.

Whitened Cross-Covariance

Let \(X\) be a \(p\)-dimensional random vector and \(Y\) a \(q\)-dimensional random vector, with finite second moments. Write their covariance matrices and cross-covariance matrix as \(\Sigma_{XX}=\operatorname{Cov}(X,X)\), \(\Sigma_{YY}=\operatorname{Cov}(Y,Y)\), and \(\Sigma_{XY}=\operatorname{Cov}(X,Y)\). Thus \(\Sigma_{YX}=\Sigma_{XY}'\). Assume throughout the main derivations that \(\Sigma_{XX}\) and \(\Sigma_{YY}\) are positive definite.

For a positive definite matrix \(\Sigma\), \(\Sigma^{1/2}\) denotes its symmetric positive definite square root, and \(\Sigma^{-1/2}\) its inverse. These are matrix operations, not element-by-element operations. Define the centered, whitened vectors and their cross-covariance matrix by

$$ X_w=\Sigma_{XX}^{-1/2}(X-E[X]),\qquad Y_w=\Sigma_{YY}^{-1/2}(Y-E[Y]),\qquad C=\Sigma_{XX}^{-1/2}\Sigma_{XY}\Sigma_{YY}^{-1/2}. $$

The covariance of \(X_w\) is \(I_p\), since \(\operatorname{Cov}(X_w,X_w)=\Sigma_{XX}^{-1/2}\Sigma_{XX}\Sigma_{XX}^{-1/2}=I_p\). Similarly, \(\operatorname{Cov}(Y_w,Y_w)=I_q\), while \(\operatorname{Cov}(X_w,Y_w)=C\).

Definition: The whitened cross-covariance matrix is \(C=\Sigma_{XX}^{-1/2}\Sigma_{XY}\Sigma_{YY}^{-1/2}\). It is the cross-covariance between the two whitened variable sets. Whitening makes each set's covariance the identity; it does not generally make the two sets uncorrelated.

From Canonical Correlation to a Singular Value

For coefficient vectors \(a\in\mathbb{R}^p\) and \(b\in\mathbb{R}^q\), the correlation between the scores \(a'(X-E[X])\) and \(b'(Y-E[Y])\) is \[ \frac{a'\Sigma_{XY}b} {\sqrt{(a'\Sigma_{XX}a)(b'\Sigma_{YY}b)}}. \] With positive definite within-set covariance matrices, both score variances are positive whenever the corresponding coefficient vector is nonzero. Set \(u=\Sigma_{XX}^{1/2}a\) and \(v=\Sigma_{YY}^{1/2}b\). Then the score variances are \(u'u\) and \(v'v\), and the score covariance is \(u'Cv\). Consequently, the canonical correlation optimization becomes the maximization of \(u'Cv\) over unit vectors \(u\) and \(v\). The sign of either coefficient vector is free, so maximizing the signed quantity gives the same maximum as maximizing its absolute value.

Theorem: Let \(C\) be the whitened cross-covariance matrix, and let its singular values be \(\sigma_1\geq \sigma_2\geq\cdots\geq 0\). The largest canonical correlation is \(\sigma_1\). More generally, the canonical roots are the singular values of \(C\), counted up to \(\min(p,q)\), including zeros when the corresponding dimensions or ranks require them.

To see the optimization at the heart of the result, let \(\|u\|=\|v\|=1\). For fixed \(v\), the Cauchy–Schwarz inequality gives \(u'Cv\leq \|Cv\|\), with equality by taking \(u\) in the direction of \(Cv\) when \(Cv\neq 0\). Therefore \[ \max_{\|u\|=\|v\|=1}u'Cv =\max_{\|v\|=1}\|Cv\|. \] The right-hand side is the operator norm of \(C\), which equals its largest singular value. This establishes the largest-root statement directly.

For the full set of roots, take an SVD \(C=U D V'\), where \(U\) and \(V\) have orthonormal columns and \(D\) has the singular values on its diagonal. The equations \(Cv_j=\sigma_j u_j\) and \(C'u_j=\sigma_j v_j\) show that each positive singular value supplies a paired direction with score correlation \(\sigma_j\). Equivalently, \(CC'u_j=\sigma_j^2u_j\) and \(C'Cv_j=\sigma_j^2v_j\). The variational characterization of successive canonical correlations imposes orthogonality to the previously selected whitened directions; the SVD gives precisely these successive singular values. Zero singular values correspond to directions with zero cross-covariance. This proves the stated correspondence. \(\square\)

Worked Example: Identity Within-Set Covariances

Suppose \(X\) and \(Y\) are both two-dimensional, with \(\Sigma_{XX}=I_2\), \(\Sigma_{YY}=I_2\), and \[ \Sigma_{XY}= \begin{pmatrix} 0.3&0.4\\ 0.4&0.3 \end{pmatrix}. \] Because both within-set covariance matrices are identity matrices, \(C=\Sigma_{XY}\). The unit vectors \(u_1=v_1=(1,1)'/\sqrt{2}\) satisfy \(Cv_1=0.7u_1\). The vectors \(u_2=(1,-1)'/\sqrt{2}\) and \(v_2=(-1,1)'/\sqrt{2}\) satisfy \(Cv_2=0.1u_2\). Thus an SVD has singular values \(0.7\) and \(0.1\); the negative eigenvalue \(-0.1\) of the symmetric matrix is not a negative canonical correlation. The canonical correlations are \(0.7\) and \(0.1\).

This covariance specification is valid: the whitened joint covariance has identity diagonal blocks and cross-block \(C\), whose largest singular value is \(0.7\leq 1\), so the joint block matrix is positive semidefinite.

Connection to the Generalized Eigenvalue Equations

The SVD representation also recovers the generalized eigenvalue equations in a symmetric form. Let \(a\) and \(b\) be canonical coefficient vectors for a nonzero canonical correlation \(\rho\), and put \(u=\Sigma_{XX}^{1/2}a\), \(v=\Sigma_{YY}^{1/2}b\). The singular-vector equations \(Cv=\rho u\) and \(C'u=\rho v\), after substituting the definitions, yield the following generalized equations.

$$ \Sigma_{XY}\Sigma_{YY}^{-1}\Sigma_{YX}a =\rho^2\Sigma_{XX}a,\qquad \Sigma_{YX}\Sigma_{XX}^{-1}\Sigma_{XY}b =\rho^2\Sigma_{YY}b. $$
Result: Under positive definite \(\Sigma_{XX}\) and \(\Sigma_{YY}\), the nonzero eigenvalues of the whitened matrices \(CC'\) and \(C'C\) are the squared canonical correlations. In particular, \[ CC'=\Sigma_{XX}^{-1/2}\Sigma_{XY}\Sigma_{YY}^{-1}\Sigma_{YX}\Sigma_{XX}^{-1/2}, \] and \(C'C=\Sigma_{YY}^{-1/2}\Sigma_{YX}\Sigma_{XX}^{-1}\Sigma_{XY}\Sigma_{YY}^{-1/2}\).

For example, the first generalized equation follows by starting with \(C v=\rho u\), using \(v=\Sigma_{YY}^{1/2}b\) and \(u=\Sigma_{XX}^{1/2}a\), and then using the paired equation \(C'u=\rho v\) to eliminate \(b\). In detail, multiplying \(C'C v=\rho^2 v\) by the appropriate covariance square roots, or directly substituting \(C\), gives \[ \Sigma_{XX}^{-1/2}\Sigma_{XY}\Sigma_{YY}^{-1}\Sigma_{YX}\Sigma_{XX}^{-1/2}u=\rho^2u. \] Since \(u=\Sigma_{XX}^{1/2}a\), multiplication by \(\Sigma_{XX}^{1/2}\) gives the first equation. The second follows by the same calculation with \(X\) and \(Y\) exchanged. Conversely, a positive eigenvalue \(\rho^2\) of either whitened product gives a singular value \(\rho\) of \(C\), with paired left and right singular vectors. Thus the symmetric eigenvalue formulation and the SVD formulation describe the same nonzero roots. \(\square\)

Worked Example: Whitening Nonidentity Covariances

Let \(\Sigma_{XX}=\operatorname{diag}(4,1)\), \(\Sigma_{YY}=\operatorname{diag}(1,9)\), and \[ \Sigma_{XY}= \begin{pmatrix} 0.6&2.4\\ 0.4&0.9 \end{pmatrix}. \] The inverse square roots are \(\Sigma_{XX}^{-1/2}=\operatorname{diag}(1/2,1)\) and \(\Sigma_{YY}^{-1/2}=\operatorname{diag}(1,1/3)\). Applying them on both sides gives \[ C= \begin{pmatrix} 1/2&0\\ 0&1 \end{pmatrix} \begin{pmatrix} 0.6&2.4\\ 0.4&0.9 \end{pmatrix} \begin{pmatrix} 1&0\\ 0&1/3 \end{pmatrix} = \begin{pmatrix} 0.3&0.4\\ 0.4&0.3 \end{pmatrix}. \] The previous example's singular-vector calculation therefore applies: the canonical correlations are \(0.7\) and \(0.1\), despite the different original within-set variances. As a check on the generalized eigenvalue formulation, \(CC'\) has eigenvalues \(0.49\) and \(0.01\), the squares of those correlations.

The joint covariance is admissible because its whitened version has identity diagonal blocks and \(C\) as its cross-block, with singular values no greater than one. Whitening has changed the scale of each variable set, not its cross-set association.

Worked Example: A Rectangular Cross-Covariance Matrix

Suppose \(p=2\), \(q=3\), both within-set covariance matrices are identity matrices, and \[ C=\Sigma_{XY}= \begin{pmatrix} 0.3&0&0\\ 0.4&0&0 \end{pmatrix}. \] The matrix has rank one. Its product with its transpose is \[ CC'= \begin{pmatrix} 0.09&0.12\\ 0.12&0.16 \end{pmatrix}, \] whose eigenvalues are \(0.25\) and \(0\): its trace is \(0.25\) and its determinant is \(0\). The singular values of \(C\) are therefore \(0.5\) and \(0\), so the two canonical correlations (there are \(\min(2,3)=2\) roots) are \(0.5\) and \(0\). The joint covariance is valid because the nonzero singular value is at most one.

This example also illustrates why a rectangular matrix causes no difficulty. The SVD works for rectangular matrices, and the number of canonical roots is limited by the smaller variable-set dimension. The rank determines how many of these roots can be nonzero.

Why the Singular Values Cannot Exceed One

For genuine covariance matrices, every singular value of \(C\) lies between zero and one. This bound is a consequence of the positive semidefiniteness of the joint covariance matrix, not an extra modeling assumption. The joint covariance of the whitened vectors is \[ \begin{pmatrix}I_p&C\\C'&I_q\end{pmatrix}. \] For any unit vectors \(u\in\mathbb{R}^p\) and \(v\in\mathbb{R}^q\), positive semidefiniteness implies that the variance of \(u'X_w+ t v'Y_w\) is nonnegative for every real \(t\). That variance is \(1+2t\,u'Cv+t^2\). A quadratic with leading coefficient one is nonnegative for all \(t\) only if its discriminant is nonpositive, so \((u'Cv)^2\leq 1\). Maximizing over unit \(u,v\) gives \(\sigma_1\leq1\), and all other singular values are no larger. Since singular values are nonnegative, each lies in \([0,1]\). \(\square\)

Common Mistakes and Practical Meaning

A common mistake is to read canonical correlations directly from the entries of \(\Sigma_{XY}\). Those entries depend on the measurement scales and the within-set covariance patterns. The relevant matrix is the whitened cross-covariance \(C\), and its singular values—not its individual entries—are the canonical correlations. In the same way, the eigenvalues of \(C\) itself are not generally the answer: \(C\) may be rectangular or nonsymmetric, and canonical correlations are nonnegative singular values.

Another mistake is to treat whitening as division by each variable's standard deviation in all cases. That operation is sufficient only when the within-set covariance matrix is diagonal. With correlated variables, the full inverse square root accounts for their covariance geometry. If a within-set covariance matrix is singular, the inverse square root used here does not exist; one must first address the reduced-rank structure or use an explicitly defined generalized-inverse approach rather than silently applying these formulas.

The SVD matters because it converts a covariance-adjusted comparison into familiar Euclidean geometry. It also offers a numerically direct route to the canonical roots and makes the squared-root eigenvalue equations transparent. In practice, the assumptions and numerical conditioning of the covariance estimates still matter: a nearly singular within-set covariance matrix can make its inverse square root unstable.

Key takeaway: Whitening makes each variable set have identity covariance. The cross-covariance left between the whitened sets is \(C\), and the singular values of \(C\) are the canonical correlations; their squares are the eigenvalues of \(CC'\) and \(C'C\).

Check Your Understanding

Use the definitions and derivations above to answer the following.

  1. Why does replacing \(a\) by \(u=\Sigma_{XX}^{1/2}a\) turn the variance of the \(X\)-score into \(u'u\)?
  2. What matrix must be decomposed to obtain the canonical correlations after whitening, and why are its singular values appropriate even when it is rectangular?
  3. If \(CC'\) has eigenvalues \(0.36\) and \(0.04\), what are the corresponding nonnegative canonical correlations?
  4. Why can the entries of \(\Sigma_{XY}\) not, by themselves, be interpreted as canonical correlations?
  5. What assumption permits the inverse square roots in the whitening definition, and what issue arises when a within-set covariance matrix is singular?
Clinical Biostats