Canonical correlation analysis finds the most correlated linear scores in two variable blocks. See whitening, the SVD solution, a checked example and estimation limits.
Canonical correlation analysis
Canonical correlation analysis (CCA) finds linear combinations of two blocks of variables whose correlation is as large as possible. It produces paired scores, called canonical variates, and a correlation for each pair. A quant researcher can use it to ask which combination of macroeconomic surprises is most closely associated with which combination of sector returns, instead of inspecting every surprise–sector correlation separately.
The blocks must describe matched observations. In that fictional application, each row might contain surprises available at a release time and returns over the same specified window after that release. CCA summarises association; a strong fitted relationship alone establishes neither a causal mechanism nor a profitable forecasting rule.
Choose a score on each side
Let X∈Rp and Y∈Rq be centred random vectors with finite second moments. Write their covariance matrices as ΣXX and ΣYY, and the cross-covariance matrix as ΣXY=Cov(X,Y). Assume the two within-block matrices are positive definite for the inverse-based construction below.
For weights a and b, the scores are U=a⊤X and V=b⊤Y. Their correlation is
Corr(U,V)=a⊤ΣXXab⊤ΣYYba⊤ΣXYb.
Multiplying a score by a positive constant does not change correlation. To fix that arbitrary scale, CCA imposes unit variances:
ρ1=a,bmaxa⊤ΣXYb,a⊤ΣXXa=1,b⊤ΣYYb=1.
These constraints normalise the scores, not the Euclidean lengths of their weight vectors. The signs can be chosen so that ρ1≥0. Reversing both score signs preserves the pair's correlation. Hotelling's original formulation and Penn State's CCA notes develop this paired optimisation.
Whitening makes the problem an SVD
Whitening transforms each centred block to have identity covariance:
X=ΣXX−1/2X,Y=ΣYY−1/2Y.
Here the inverse square roots are symmetric. Whitening removes within-block correlations as well as rescaling variances; dividing every column by its own standard deviation is sufficient only when its block is already uncorrelated.
Take the singular value decomposition of the whitened cross-covariance:
K=ΣXX−1/2ΣXYΣYY−1/2=PDQ⊤.
The diagonal entries of D, ordered largest first, are the canonical correlations 1≥ρ1≥⋯≥ρm≥0, with m=min(p,q). If pi and qi are the corresponding left and right singular vectors, the weights in the original coordinates are
ai=ΣXX−1/2pi,bi=ΣYY−1/2qi.
Successive pairs use new directions that are uncorrelated with earlier scores within each block. In this canonical basis, cross-pair covariances also vanish:
Cov(Ui,Uj)=Cov(Vi,Vj)=0,Cov(Ui,Vj)=0(i=j).
The orthogonality is in the covariance geometry: ai⊤ΣXXaj=0, rather than necessarily ai⊤aj=0. Uncorrelated scores need not be independent. Equal canonical correlations also leave freedom to rotate the associated directions, so individual weights need not be unique. See Uurtio and colleagues' SVD treatment.
Two macro scores, two return scores
Consider an exact fictional population, with centred macro-surprise variables X1,X2 and centred sector-return scores Y1,Y2. These are illustrative numerical units, not empirical estimates or annualised returns. Suppose
ΣXX=(4001),ΣYY=(1001),ΣXY=(1.2000.4).
The first macro variable has standard deviation 2. Whitening divides it by 2, while leaving the other variables unchanged:
K=(1/2001)(1.2000.4)=(0.6000.4).
Thus the canonical pairs are
Pair
Macro score
Return score
Canonical correlation
First
U1=X1/2
V1=Y1
0.6
Second
U2=X2
V2=Y2
0.4
For the first pair, Var(X1/2)=4/4=1 and Cov(X1/2,Y1)=1.2/2=0.6. A covariance of 1.2 is therefore entirely consistent with a correlation below one. In this deliberately diagonal example, the best combinations select single coordinates; generally they mix several variables.
In an exact fictional population, X1 has standard deviation 2 and X2 has standard deviation 1. Whitening gives U1=X1/2 and U2=X2, both with variance 1. Their matched Y scores have correlations 0.6 and 0.4; all cross-pair covariances are zero.
Exact fictional population. Whitening converts the first cross-covariance from 1.2 to a unit-free correlation of 0.6; both canonical pairs have unit-variance scores.
The square 0.62=0.36 is the population R2 from regressing this one canonical score on its paired score with an intercept. It does not mean that 36% of the variance of the entire two-variable return block is explained. CCA can find a strongly associated direction without that direction carrying much of a block's total variance.
CCA, PCA and regression answer different questions
Method
What is chosen?
Objective
Principal component analysis (PCA)
Directions in one block
Capture that block's variance, under a specified scaling
Coefficients mapping predictors to a specified response
Minimise prediction error under the chosen loss
CCA is symmetric between its blocks. Regression assigns predictor and response roles. A high-variance PCA direction can be irrelevant to the other block, while a low-variance direction can matter greatly to CCA after whitening. When one block contains only a single nonconstant response, classical CCA's first correlation equals the multiple correlation from ordinary least squares with an intercept; its square is that regression's R2.
A fitted maximum is an optimistic starting point
Sample CCA replaces population covariances with estimates. Searching over many directions creates overfitting: a large training correlation can reflect fitted noise. Collinear inputs make weights unstable, and centred sample covariance matrices have rank at most n−1. They are necessarily singular if a block has at least n columns. The ordinary inverse square root then does not exist.
Removing redundant directions or using regularisation can make estimation feasible. These choices alter the fitted problem; a pseudoinverse or ridge penalty does not establish that an apparent relationship generalises. Tuzhilina, Tozzi and Hastie describe the singular-covariance problem, regularised CCA and validation of fixed fitted weights.
For the fictional macro study, fit centring, scaling, dimension reduction and CCA weights on training dates only. Apply those fixed transformations to later held-out dates. Tune any penalty inside the training process, then evaluate on untouched data. Using future releases or fitting preprocessing on the full history introduces look-ahead bias; overlapping return windows also require care when separating observations. Report held-out score correlations and weight stability alongside the training maximum.
In another exact centred population, let ΣXX=diag(9,1), ΣYY=I and ΣXY=diag(1.5,0.7). Does the first canonical pair select the first coordinates because 1.5>0.7?
Answer. No. The X standard deviations are 3 and 1, so the whitened cross-covariance is diag(0.5,0.7). Its ordered singular values are 0.7 and 0.5. The first pair is U1=X2, V1=Y2; the second is U2=X1/3, V2=Y1. Ranking raw covariances ignores the variance constraints.
Sources
Harold Hotelling, Relations Between Two Sets of Variates, Biometrika 28 (1936), §3, especially pp. 326–329 — the original unit-variance optimisation and canonical transformations.
Penn State, STAT 505: Canonical Correlation Analysis, §§13.1 and 13.3 — paired linear combinations, successive uncorrelated scores and the interpretation of squared canonical correlations.