Testing Association Between Two Gaussian Variable Sets
Canonical correlation analysis describes the strongest linear associations between two sets of variables. In a sample, even unrelated sets can exhibit nonzero canonical correlations: the procedure searches for directions that align as well as possible. A likelihood ratio gives a way to assess the overall evidence against zero cross-covariance, while making clear what model assumptions are required.
Let \(X\) be a \(p\)-dimensional random vector and \(Y\) a \(q\)-dimensional random vector, observed together on each of \(n\) independent subjects. The question here is whether their population cross-covariance is zero. We assume a joint Gaussian model with unknown means and an otherwise unrestricted positive-definite covariance matrix under the alternative.
The means of both variable sets are unrestricted under both hypotheses. Thus the test concerns covariance association, not differences in mean vectors. Let \(X_i,Y_i\) denote observation \(i\), and let \(\bar X,\bar Y\) be their sample means. Define the centered sample covariance blocks, using the maximum-likelihood divisor \(n\), by
The full sample covariance matrix is \(S=\begin{pmatrix}S_{XX}&S_{XY}\\S_{YX}&S_{YY}\end{pmatrix}\). For the determinant formulas below, assume \(S\) is positive definite. This requires \(n\) to exceed \(p+q\); under a nonsingular continuous Gaussian population, that condition gives positive definiteness with probability one. Positive definiteness is important: if \(S\) is singular, the unrestricted Gaussian covariance likelihood has no finite maximum.
Likelihood Ratio From the Two Covariance Fits
Define the likelihood ratio as the maximized likelihood under the null divided by the maximized likelihood under the alternative. It therefore lies between zero and one, and small values indicate that imposing zero cross-covariance fits the data poorly relative to the unrestricted model.
The first equality follows from maximizing the Gaussian likelihood in each model. To see this, center the observations at their common-model maximum likelihood estimates \(\bar X,\bar Y\), and let \(C=nS\) be the centered sum-of-products matrix. For a covariance matrix \(\Omega\) in dimension \(d=p+q\), the log-likelihood, after substituting the fitted means, is
In the unrestricted model, differentiating with respect to \(\Omega\), or using the standard Gaussian covariance maximum likelihood result, gives \(\hat\Omega=S=C/n\). Its trace term is \(\operatorname{tr}(S^{-1}nS)=n(p+q)\). Under \(H_0\), the covariance must be block diagonal. The likelihood separates into an \(X\) part and a \(Y\) part, so the maximizing covariance is \(\operatorname{diag}(S_{XX},S_{YY})\); its trace term is also \(np+nq\). The trace contributions and all common constants cancel in the likelihood ratio. The remaining determinant terms give
This derivation uses the maximum-likelihood covariance estimates, which have divisor \(n\). It also shows why the means do not create an extra comparison: they are estimated in the same way under both models. \(\square\)
Why Canonical Correlations Appear
For positive-definite \(S_{XX}\) and \(S_{YY}\), the squared sample canonical correlations are the nonzero eigenvalues of \(S_{XX}^{-1}S_{XY}S_{YY}^{-1}S_{YX}\), with zeros included as needed to give \(m\) roots. The connection to the likelihood ratio is a determinant identity.
Take the Schur complement of \(S_{XX}\) in \(S\). Block determinant factorization gives
Factoring \(S_{YY}\) from the second determinant and using \(|I-AB|=|I-BA|\) for compatible rectangular matrices yields
The equality between the determinants of \(I-AB\) and \(I-BA\) ensures that the nonzero eigenvalues can be computed from either variable set, even when \(p\ne q\). Positive definiteness of the full \(S\) implies \(0\leq\hat\rho_j^2<1\), so every factor is positive. Combining this identity with the likelihood calculation proves the stated result. \(\square\)
Equivalently, the likelihood-ratio deviance is \(-2\log R=-n\sum_{j=1}^{m}\log(1-\hat\rho_j^2)\). This is a transformation of the same statistic, not a new calibration rule: deciding a significance level requires the null distribution or a justified approximation, topics separate from the likelihood reduction itself.
Worked Examples
Worked Example: One Variable in Each Set
Suppose \(p=q=1\), \(n=12\), and the observed sample covariance entries are \(S_{XX}=4\), \(S_{YY}=9\), and \(S_{XY}=3\). Calculate the sample canonical correlation and the likelihood ratio.
With one variable in each set, the sole sample canonical correlation is the ordinary sample correlation: \[ \hat\rho=\frac{S_{XY}}{\sqrt{S_{XX}S_{YY}}} =\frac{3}{\sqrt{4\cdot9}}=\frac{3}{6}=0.5. \] The full sample covariance matrix has determinant \[ |S|=4\cdot9-3^2=36-9=27, \] and the product of its diagonal blocks is \(4\cdot9=36\). Thus \[ R=\left(\frac{27}{36}\right)^{12/2} =(0.75)^6\approx0.17798. \] The canonical-root expression checks the same result: \[ (1-\hat\rho^2)^{n/2}=(1-0.25)^6=0.75^6\approx0.17798. \] This is the observed likelihood ratio, not a p-value; a null distribution is needed to turn it into a significance decision.
Worked Example: Two Canonical Roots
Suppose \(p=q=2\), \(n=20\), and the sample covariance blocks are \(S_{XX}=I_2\), \(S_{YY}=I_2\), and \(S_{XY}=\operatorname{diag}(0.6,0.3)\). Find the roots and likelihood ratio, and verify that the covariance matrix is positive definite.
Here \(S_{XX}\) and \(S_{YY}\) are identity matrices, so the squared canonical correlations are the eigenvalues of \(S_{XY}S_{YX}\). Since this product is \(\operatorname{diag}(0.36,0.09)\), the sample canonical correlations are \(0.6\) and \(0.3\). The full covariance matrix separates into two \(2\)-by-\(2\) blocks with diagonal entries \(1,1\) and off-diagonal entries \(0.6\) and \(0.3\). Their determinants are \(1-0.6^2=0.64\) and \(1-0.3^2=0.91\), both positive; hence the full matrix is positive definite.
The likelihood ratio is therefore \[ R=[(1-0.6^2)(1-0.3^2)]^{20/2} =(0.64\cdot0.91)^{10} =(0.5824)^{10}\approx0.00449. \] The calculation includes both roots: omitting the weaker root would change the statistic and would no longer represent the global test of zero cross-covariance.
Worked Example: Zero Covariance Need Not Mean Independence
Let \(X\) take values \(-1,0,1\), each with probability \(1/3\), and set \(Y=X^2\). Compute the covariance and check whether \(X\) and \(Y\) are independent.
The expectations are \(E[X]=(-1+0+1)/3=0\) and \(E[Y]=(1+0+1)/3=2/3\). Also \(E[XY]=E[X^3]=(-1+0+1)/3=0\). Thus \[ \operatorname{Cov}(X,Y)=E[XY]-E[X]E[Y]=0-(0)(2/3)=0. \] But \(Y\) is determined by \(X\): when \(X=0\), \(Y=0\) with conditional probability one, whereas \(P(Y=0)=1/3\). Therefore \(X\) and \(Y\) are dependent. This discrete distribution is not jointly Gaussian, illustrating why zero cross-covariance alone does not imply independence without the Gaussian assumption.
Assumptions, Interpretation, and Common Pitfalls
The likelihood-ratio calculation is a comparison of two Gaussian covariance models. Its classical testing interpretation relies on independent observations from a joint multivariate normal population, unknown means treated identically in both models, and covariance matrices for which the relevant maximum likelihood estimates exist. In particular, the unrestricted sample covariance must be positive definite. If the number of centered observations is too small relative to \(p+q\), or the data are rank deficient, the unrestricted Gaussian likelihood can increase without bound as a covariance eigenvalue approaches zero. In that case the ordinary likelihood ratio above is not defined by finite maximum likelihood estimates.
Under the Gaussian model, \(H_0:\Sigma_{XY}=0\) says the variable sets are independent. Without joint Gaussianity, the test still forms a Gaussian likelihood-based statistic from the observed covariance matrices, but zero covariance does not establish independence and the classical null calibration need not apply. Dependence can also be nonlinear, as the worked example shows.
- Do not confuse a canonical correlation with its square. The determinant factors use \(1-\hat\rho_j^2\), not \(1-\hat\rho_j\).
- Do not read the likelihood ratio as a p-value. It measures relative maximized likelihood; a sampling distribution is needed for a test decision.
- Do not use the independence interpretation without its condition. Zero cross-covariance implies independence for a jointly Gaussian vector, not for arbitrary distributions.
- Check rank before applying the formula. A singular full sample covariance invalidates the unrestricted finite Gaussian maximum likelihood fit.
- Keep the likelihood convention clear. Here \(R\) is null maximum divided by alternative maximum, so stronger evidence against the null corresponds to smaller \(R\).
Check Your Understanding
Use the definitions and derivations above to answer the following questions.
- State the null and alternative covariance restrictions for the global test.
- Why do the unknown mean vectors not create different terms in the null and alternative likelihood fits?
- If the sample canonical correlations are \(0.5\) and \(0.2\), write the likelihood ratio for sample size \(n\).
- Why does a singular full sample covariance prevent the ordinary unrestricted Gaussian maximum likelihood fit?
- Give the condition under which zero cross-covariance also implies independence of the two variable sets.