Why Test Correlations Rather Than Covariances?
Two groups can have the same pattern of linear association while differing substantially in the units or spread of their variables. For example, a clinical measurement may be much more variable in one group, even if its correlation with another measurement is unchanged. Equality of covariance matrices would rule out those scale differences; equality of correlation matrices does not.
This distinction leads to a likelihood-ratio test with an important nuisance feature: under the null hypothesis, each group has its own marginal variances, while all groups share one correlation matrix. The group-specific scales must be estimated along with the common correlation matrix. They cannot generally be removed by simply averaging the observed correlations.
The diagonal entries of \(D_g\) are marginal standard deviations, not variances: the \(j\)th marginal variance is \(d_{gj}^2\). This parameterization is unique for a positive-definite covariance matrix, because its diagonal determines the marginal standard deviations and standardizing by them determines its correlation matrix.
Likelihood and the Likelihood-Ratio Statistic
Suppose the observations are independent across groups and, within each group, \(X_{gi}\sim N_p(\mu_g,\Sigma_g)\). Let \(n_g\) be the size of group \(g\), let \(\bar X_g\) be its sample mean, and define the maximum-likelihood sample covariance matrix
Assume \(S_g\) is positive definite in every group; a sufficient condition for this in ordinary continuous data is \(n_g>p\), though the condition is positive definiteness itself. Profiling the unrestricted group means sets their estimates to \(\bar X_g\). Apart from constants that are the same under both hypotheses, the negative twice log likelihood to minimize over the covariance matrices is
Under the alternative, each \(\Sigma_g\) is unrestricted and its maximum-likelihood estimate is \(S_g\). Under the null, minimize the same objective over a common positive-definite correlation matrix \(R\) and group-specific positive diagonal matrices \(D_g\). Denote the resulting covariance estimates by \(\widehat\Sigma_{0g}=\widehat D_g\widehat R\widehat D_g\).
To prove the formula, under the alternative the fitted covariance in group \(g\) is \(S_g\), so its trace contribution is \(\operatorname{tr}(S_g^{-1}S_g)=p\). At the null maximum, the trace contribution is also \(p\) separately in each group. Indeed, multiply a fitted \(D_g\) by a positive scalar \(c\), holding \(R\) fixed. This changes \(\Sigma_g\) to \(c^2\Sigma_g\), and the group’s objective becomes \(n_g\{2p\log c+\log|\Sigma_g|+c^{-2}\operatorname{tr}(\Sigma_g^{-1}S_g)\}\). At an interior optimum, its derivative with respect to \(c\), evaluated at \(c=1\), is zero. Thus \(2p-2\operatorname{tr}(\Sigma_g^{-1}S_g)=0\), proving the trace contribution is \(p\). Subtracting the two profiled log likelihoods cancels these equal trace terms and leaves the displayed sum of log determinant ratios. The null fits a subset of the alternative models, so every ratio in the sum is at least one at the joint null optimum and the statistic is nonnegative. \(\square\)
What Must Be Estimated Under the Null?
The null optimization has no general closed-form solution. For a proposed common \(R\), the matrices \(D_g\) must still be selected to fit each group’s marginal scales. One useful characterization comes from differentiating the objective with respect to each log-standard-deviation. Set \(A_g=D_g^{-1}S_gD_g^{-1}\). Since \(\log|D_gRD_g|=2\sum_j\log d_{gj}+\log|R|\), differentiation with respect to \(\log d_{gj}\) gives the following necessary scale equations at an interior optimum:
For verification, the derivative of the log-determinant term is \(2\). The derivative of the trace term with respect to \(\log d_{gj}\) is \(-2(R^{-1}D_g^{-1}S_gD_g^{-1})_{jj}\); setting their sum to zero gives the equation. These equations show why the marginal scales are nuisance parameters that still affect the fit of \(R\): the fitted scale in one coordinate depends on the proposed correlations and the observed covariances in that group.
In practice, one can minimize the null objective over positive diagonal \(D_g\) and positive-definite correlation matrices \(R\), using a parameterization that respects those constraints. The likelihood-ratio statistic is then computed from the fitted determinants. A pooled average of the sample correlation matrices is not, in general, the null maximum-likelihood estimate.
Worked Examples
Worked Example: Different Covariances but Identical Correlations
Consider two groups with maximum-likelihood sample covariance matrices
Both matrices are positive definite: their determinants are \(4-0.64=3.36\) and \(9-1.44=7.56\), respectively. Their sample correlations are \(0.8/\sqrt{1\cdot4}=0.4\) and \(1.2/\sqrt{9\cdot1}=0.4\). Thus the data covariance matrices differ, but they have exactly the same correlation matrix.
Under the common-correlation null, choose \(R\) with off-diagonal entry \(0.4\), and choose \(D_1=\operatorname{diag}(1,2)\) and \(D_2=\operatorname{diag}(3,1)\). Then \(D_1RD_1=S_1\) and \(D_2RD_2=S_2\). The null fits both sample covariance matrices exactly, so \(|\widehat\Sigma_{0g}|=|S_g|\) in each group and \(-2\log\Lambda=0\). The groups’ marginal variances differ, but those differences do not contradict equality of correlations.
Worked Example: A Bivariate Test with Unequal Observed Correlations
Suppose there are two groups of size \(n_1=n_2=20\), with sample covariance matrices
The first sample correlation is \(r_1=0\); the second is \(r_2=3/\sqrt{4\cdot9}=1/2\). Both covariance matrices are positive definite, with determinants \(1\) and \(27\).
For a bivariate group with sample covariance entries \(a,b,c\) and sample correlation \(r=c/\sqrt{ab}\), write the candidate fitted covariance with correlation \(\rho\) as \(\begin{pmatrix}v_1&\rho\sqrt{v_1v_2}\\\rho\sqrt{v_1v_2}&v_2\end{pmatrix}\). At fixed \(\rho\), put \(x=\sqrt{a/v_1}\) and \(y=\sqrt{b/v_2}\). Differentiating the group objective with respect to the two log-scales gives \(x^2-\rho rxy=1-\rho^2\) and \(y^2-\rho rxy=1-\rho^2\). Subtracting these equations yields \(x^2=y^2\); since both are positive, \(x=y\). Consequently \(x^2=y^2=(1-\rho^2)/(1-\rho r)\), and the fitted variances are \(v_1=a(1-\rho r)/(1-\rho^2)\) and \(v_2=b(1-\rho r)/(1-\rho^2)\).
The fitted determinant divided by the sample determinant is therefore \[ \frac{v_1v_2(1-\rho^2)}{ab(1-r^2)} =\frac{(1-\rho r)^2}{(1-\rho^2)(1-r^2)}. \] For the two groups, minimize the sum of the log ratios, since both sample sizes are equal. Apart from the positive factor \(20\), this objective is \(\log\{1/(1-\rho^2)\}+\log\{(1-\rho/2)^2/[(1-\rho^2)(3/4)]\}\). Its derivative is
On \((-1,1)\) the denominator is positive. The numerator is negative before its root \(2-\sqrt{3}\) and positive after it; the other root \(2+\sqrt{3}\) lies outside this interval. The objective therefore decreases and then increases, so its minimum is at \(\widehat\rho=2-\sqrt{3}\approx0.26795\). In particular, the derivative is negative at \(\rho=0\), consistent with the objective decreasing there.
At this fitted value, \(1-\widehat\rho^2=4\sqrt{3}-6\), and both determinant ratios equal \(1/(1-\widehat\rho^2)\). The test statistic is \[ -2\log\Lambda =40\log\left(\frac{1}{4\sqrt{3}-6}\right) \approx 2.98. \] This is the likelihood-ratio statistic; its asymptotic reference distribution is addressed below.
Worked Example: Counting the Wilks Degrees of Freedom
Suppose there are \(k=4\) groups and \(p=3\) variables. A \(3\times3\) correlation matrix has \(q=p(p-1)/2=3\) free off-diagonal correlations. Under the unrestricted alternative, the four groups have \(4q=12\) correlation parameters. Under the null, they share one correlation matrix, with \(q=3\) parameters.
Both models also have \(kp=12\) group-specific marginal standard deviations, as well as the same group-specific mean parameters. These parameters do not contribute to the difference in dimension. The difference is \(12-3=9\), equivalently \((k-1)p(p-1)/2=9\). Under the regularity conditions for Wilks’ theorem, the statistic is calibrated asymptotically against a chi-square distribution with 9 degrees of freedom.
Asymptotic Calibration and Interpretation
A positive-definite correlation matrix has \(q=p(p-1)/2\) free parameters: its diagonal is fixed at one and its off-diagonal entries are otherwise constrained only by positive definiteness. The alternative has \(kq\) correlation parameters, while the null has \(q\). The group-specific scale and mean parameters occur in both models, so they cancel from the dimension difference.
This is Wilks’ theorem applied to the difference in the dimensions of two nested, regular likelihood models. The common-correlation restriction imposes \((k-1)q\) independent restrictions, and positive group proportions ensure that each group contributes information asymptotically. The result is an asymptotic calibration, not an exact finite-sample distribution. In particular, it depends on the Gaussian model and the stated interior and sample-size conditions.
A common mistake is to read “equal correlation matrices” as “equal covariance matrices,” or to use an equal-covariance test for this hypothesis. That imposes extra restrictions on the marginal variances and answers a different question. The correction is to retain each group’s \(D_g\) under the null and optimize those nuisance scales along with \(R\). A related error is to set the common correlation estimate equal to an unweighted average of the observed correlations: the likelihood weights and scale fits jointly determine the null estimate, so that average need not maximize the likelihood.
Check Your Understanding
Use the definitions and derivations above to answer the following.
- Why does equality of covariance matrices imply equality of correlation matrices, while the reverse implication need not hold?
- In the null parameterization \(\Sigma_g=D_gRD_g\), what does the \(j\)th diagonal entry of \(D_g\) represent?
- Explain why the trace contribution at each group’s null maximum is \(p\), even though the covariance matrices are constrained.
- For \(k=3\) groups and \(p=4\) variables, calculate the Wilks degrees of freedom.
- Why is an unweighted average of group sample correlations not generally the maximum-likelihood estimate of the common correlation matrix?