Why Regularize CCA?
Canonical correlation analysis (CCA) seeks linear combinations of two data blocks whose scores have strong association. Its classical version uses each block's covariance matrix to normalize the weights. When variables are highly correlated, or there are many variables relative to observations, those covariance matrices can be singular or nearly singular. The earlier material on CCA with singular covariance matrices explains why this creates a computational problem: the standard whitening or generalized eigenvalue calculation may require an inverse that does not exist or is numerically unstable.
Ridge CCA addresses this problem by adding a nonnegative diagonal penalty to each within-block covariance matrix. The penalties make the matrices better conditioned and, when strictly positive, ensure they are invertible. The price is that the result no longer normalizes scores solely by their observed variances. It normalizes them using observed variance plus a penalty, so the reported ridge association is an explicitly regularized quantity.
The data blocks are assumed to have the same observational units in corresponding rows, and the covariance estimates must be based on appropriately centered, matched observations. Sample covariance matrices are positive semidefinite. If \(\lambda_x>0\), then \(A\) is positive definite; if \(\lambda_y>0\), then \(B\) is positive definite. These facts guarantee invertibility for calculations involving the corresponding inverse. A zero penalty does not guarantee invertibility: the relevant sample covariance matrix must itself be positive definite.
The penalties have the same units as the covariances they are added to. Therefore, ridge CCA is scale-dependent: changing a variable's units changes its variance and the relative impact of a fixed penalty. Variables are commonly standardized when equal penalty impact across variables is intended, but that choice changes the analysis and should be reported. Ridge CCA is an estimation method; its eigenvalue calculation alone does not supply a significance test or establish a causal relationship.
Deriving the Ridge Generalized Eigenproblem
Use separate multipliers for the two normalization constraints. This is essential: the constraints are distinct, so their multipliers cannot simply be presumed equal. For a nonzero optimum, the Lagrangian is
Setting the derivatives with respect to \(a\) and \(b\) to zero gives
Multiply the first equation on the left by \(a^{\mathsf T}\), and the second by \(b^{\mathsf T}\). By the two unit constraints and the equality \(b^{\mathsf T}S_{yx}a=a^{\mathsf T}S_{xy}b\), these yield
Thus \(\alpha=\beta=a^{\mathsf T}S_{xy}b\). Denote their common value by \(\rho\), the optimized objective value. The stationarity equations become \(S_{xy}b=\rho Aa\) and \(S_{yx}a=\rho Bb\). For a positive leading association, eliminate \(b\) using the second equation, then substitute into the first:
This is a generalized eigenvalue problem. Its largest relevant eigenvalue is \(\rho^2\), and the corresponding eigenvector supplies the \(X\)-block weights; the other block's weights follow from the stationarity equations. Equivalently, the nonzero squared associations are eigenvalues of the symmetric matrix \(A^{-1/2}S_{xy}B^{-1}S_{yx}A^{-1/2}\) when \(A\) and \(B\) are positive definite. This form shows how ridge CCA can be computed by whitening with the penalized, rather than the unpenalized, covariance matrices.
The objective is bounded in magnitude by one when the covariance blocks are valid and penalties are nonnegative. Indeed, for any \(a,b\), the covariance Cauchy–Schwarz inequality gives \(|a^{\mathsf T}S_{xy}b|\leq\sqrt{(a^{\mathsf T}S_{xx}a)(b^{\mathsf T}S_{yy}b)}\). Each penalized quadratic form is at least its unpenalized counterpart. Under the ridge unit constraints, this implies \(|a^{\mathsf T}S_{xy}b|\leq 1\). A positive penalty can therefore shrink the optimized association relative to the classical maximum, rather than make it exceed one.
Worked Example: One Variable in Each Block
Suppose a hypothetical pair of centered variables has sample variances \(S_{xx}=4\), \(S_{yy}=9\), and sample covariance \(S_{xy}=3\). Choose \(\lambda_x=1\) and \(\lambda_y=4\). The penalized variances are \(A=4+1=5\) and \(B=9+4=13\). The scalar constraints require \(|a|=1/\sqrt{5}\) and \(|b|=1/\sqrt{13}\). Choose their signs to make the cross-covariance positive.
The ridge objective is
For comparison, the ordinary sample correlation is \(3/\sqrt{4\cdot9}=3/6=0.5000\). Thus the penalty changes the value from 0.5000 to 0.3721; the ridge value is not the ordinary correlation of the original variables. The calculation also verifies the constraints: \(a^2A=(1/5)5=1\), and \(b^2B=(1/13)13=1\).
What the Penalty Does to the Solution
Adding a positive diagonal term increases the eigenvalues of the within-block matrices and prevents directions with very small or zero observed variance from causing an unstable inverse. In an eigenbasis of \(S_{xx}\), an eigenvalue \(d\geq0\) becomes \(d+\lambda_x\). The smallest eigenvalue is therefore at least \(\lambda_x\), and the condition number of \(A\) is \((d_{\max}+\lambda_x)/(d_{\min}+\lambda_x)\). When \(d_{\min}=0\), a positive penalty replaces a zero denominator with \(\lambda_x\); increasing the penalty generally reduces the disparity between the largest and smallest eigenvalues.
This stabilization does not mean that ridge CCA removes every source of error. It trades some unpenalized fit for greater stability. A direction with small within-block variance is penalized more heavily relative to that variance than a direction with large variance. The resulting weights may be less sensitive to small perturbations, while the estimated association may be smaller. The weights and the ridge association both depend on the units, preprocessing, and selected penalties.
Worked Example: Two Diagonal Covariance Blocks
Consider hypothetical two-variable blocks with \(S_{xx}=S_{yy}=I_2\) and \(S_{xy}=\begin{pmatrix}0.8&0\\0&0.4\end{pmatrix}\). Let both penalties be \(0.5\), so \(A=B=1.5I_2\). The whitened cross-block matrix is \(A^{-1/2}S_{xy}B^{-1/2}=S_{xy}/1.5\), whose singular values are \(0.8/1.5=0.5333\) and \(0.4/1.5=0.2667\).
The leading ridge association is therefore \(0.5333\). The generalized eigenvalue check gives
The second squared association is \(0.4^2/2.25\approx0.07111\), giving \(\rho_2\approx0.2667\). In this diagonal example, the leading weights select the first variable from each block. For example, \(a=b=(1/\sqrt{1.5},0)^{\mathsf T}\) satisfy both penalized unit constraints, and \(a^{\mathsf T}S_{xy}b=0.8/1.5=0.5333\). The arithmetic illustrates why the eigenvalue is a squared association: take its square root to obtain the nonnegative optimized objective.
Worked Example: Ridge CCA When a Covariance Matrix Is Singular
Suppose hypothetical covariance estimates are \(S_{xx}=\begin{pmatrix}1&1\\1&1\end{pmatrix}\), \(S_{yy}=(1)\), and \(S_{xy}=(0.6,0.6)^{\mathsf T}\). The \(X\)-block variables have identical covariance rows, so \(S_{xx}\) is singular. Set \(\lambda_x=0.5\) and \(\lambda_y=0.25\). Then \(A=\begin{pmatrix}1.5&1\\1&1.5\end{pmatrix}\) and \(B=(1.25)\), both positive definite.
The matrix in the generalized eigenproblem is \(S_{xy}B^{-1}S_{yx}=0.36(1.25)^{-1}\begin{pmatrix}1&1\\1&1\end{pmatrix}=0.288\begin{pmatrix}1&1\\1&1\end{pmatrix}\). In the direction \((1,1)^{\mathsf T}\), this matrix has eigenvalue \(0.576\), while \(A\) has eigenvalue \(2.5\). Hence
The normalized weights \(a=(1/\sqrt{5},1/\sqrt{5})^{\mathsf T}\) and \(b=1/\sqrt{1.25}\) achieve this value: \(a^{\mathsf T}Aa=1\), \(b^2B=1\), and \(a^{\mathsf T}S_{xy}b=0.4800\). The original, unpenalized score variances are \(a^{\mathsf T}S_{xx}a=0.8\) and \(b^{\mathsf T}S_{yy}b=0.8\), while their covariance is \(0.48\); their ordinary score correlation is consequently \(0.48/\sqrt{0.8\cdot0.8}=0.6000\). The ridge objective is 0.4800, not that ordinary score correlation. Positive penalties made the eigenproblem well-defined despite the singular \(S_{xx}\).
Diagnostics, Alternatives, and Limitations
A useful diagnostic is to inspect the eigenvalues or condition numbers of the unpenalized and penalized covariance matrices. If a matrix remains nearly singular after the chosen penalty, numerical sensitivity may persist. Also check that estimated covariance matrices are symmetric and positive semidefinite up to numerical tolerance, that rows are correctly matched across blocks, and that all preprocessing and variable scaling are documented. Large changes in weights under modest data perturbations can signal that the solution is still unstable, even when the matrix inversion completes.
Ridge CCA is not the only response to a singular covariance matrix. Classical CCA is appropriate when the within-block covariance matrices are nonsingular and the unpenalized objective is the intended target. Removing redundant variables or restricting each block to a lower-dimensional subspace can also make a calculation possible, but changes the available directions and can discard information. Ridge instead retains all variables while damping directions through the covariance penalty. These choices answer different analytic needs; none makes a weakly identified association automatically reliable.
The main limitations are that ridge CCA does not usually produce exactly zero weights, depends on the measurement scale, and can yield unstable interpretation if the data do not support the chosen directions. Its penalties must be selected and reported; comparisons across analyses are meaningful only when preprocessing, covariance conventions, and penalties are clear. Ridge regularization also does not by itself correct confounding, missingness, batch effects, or dependence among observational units.
Common Mistakes
- Using one multiplier without proof. The two constraints have separate multipliers. Derive the stationarity equations with distinct values, then show they coincide by multiplying by the corresponding constrained vectors.
- Confusing the eigenvalue with the association. The generalized eigenvalue is \(\rho^2\); take its nonnegative square root to obtain the optimized ridge objective.
- Calling the ridge objective the ordinary score correlation. Ridge normalizes with \(S_{xx}+\lambda_x I\) and \(S_{yy}+\lambda_y I\), not just observed score variances. State which quantity is reported.
- Assuming any penalty is harmless. Penalties alter the estimand, depend on scale, and can over-shrink useful directions. A stable inverse alone does not establish a scientifically useful solution.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- In one-variable-per-block ridge CCA, let \(S_{xx}=1\), \(S_{yy}=4\), \(S_{xy}=1\), and \(\lambda_x=\lambda_y=1\). What is the ridge association?
- Why are separate Lagrange multipliers used initially, and what shows they are equal at a constrained optimum?
- If \(S_{xx}\) has a zero eigenvalue, what does adding \(\lambda_x I\) with \(\lambda_x>0\) do to that eigenvalue?
- Can the ridge objective be interpreted as the ordinary correlation of the original canonical scores? Explain.
Solutions. (1) \(A=2\), \(B=5\), so \(\rho=1/\sqrt{10}\approx0.3162\). (2) There are two distinct constraints, so the Lagrangian has multipliers \(\alpha\) and \(\beta\); multiplying the respective stationarity equations by \(a^{\mathsf T}\) and \(b^{\mathsf T}\), and using both unit constraints, gives \(\alpha=a^{\mathsf T}S_{xy}b=\beta\). (3) The zero eigenvalue becomes \(\lambda_x\), which is strictly positive. (4) No, not in general: the ridge objective uses penalized quadratic forms for normalization, whereas the ordinary score correlation uses only the observed score variances.