Tutorials › Multivariate Statistics (Graduate) › Testing Compound-Symmetry Covariance

Covariance Matrix Inference · Tutorial 254 of 975

Testing Compound-Symmetry Covariance

Learn to fit compound-symmetry covariance under a Gaussian model and calibrate the likelihood-ratio test against an unrestricted covariance alternative.

Intermediate 11 min read

What You'll Learn

  • Define compound symmetry using a common diagonal variance and a common off-diagonal covariance
  • State the positive-definiteness constraints on the two covariance parameters
  • Derive the constrained Gaussian maximum-likelihood estimates
  • Write the likelihood-ratio statistic using the sample covariance determinant
  • Count the null and alternative covariance parameters to obtain the degrees of freedom
  • Distinguish the large-sample chi-square calibration from an exact finite-sample test

Why Test Compound Symmetry?

In repeated-measures and multivariate studies, a covariance model can summarize dependence across several measurements with relatively few parameters. Compound symmetry is one such model: every variable has the same variance, and every distinct pair has the same covariance. The likelihood-ratio test asks whether this parsimonious structure is compatible with the data, compared with allowing every covariance entry to vary freely.

The test concerns the covariance matrix, not the mean vector. We allow the mean of each component to be different and estimate the whole mean vector without restriction under both hypotheses. Let \(X_1,\ldots,X_n\) be independent observations from \(N_p(\mu,\Sigma)\), where \(p\geq 2\). Define the sample mean and the maximum-likelihood-scaled sample covariance by

$$ \bar X=\frac{1}{n}\sum_{i=1}^n X_i, \qquad S=\frac{1}{n}\sum_{i=1}^n (X_i-\bar X)(X_i-\bar X)'. $$

For the unrestricted covariance maximum-likelihood estimate to be positive definite, assume \(S\) is positive definite; this holds with probability one under the model when \(n>p\). The denominator in \(S\) is \(n\), not \(n-1\), because \(S\) is being used as a maximum-likelihood estimate.

Hypotheses and the Constrained Parameters

Definition: A \(p\times p\) covariance matrix has compound symmetry if it can be written $$ \Sigma(a,b)=(a-b)I_p+b\mathbf{1}\mathbf{1}', $$ where \(a\) is the common diagonal variance, \(b\) is the common off-diagonal covariance, \(I_p\) is the identity matrix, and \(\mathbf{1}\) is the \(p\)-vector of ones. The hypotheses are \(H_0:\Sigma=\Sigma(a,b)\) for some admissible \(a,b\), against \(H_1:\Sigma\) is any positive-definite symmetric \(p\times p\) matrix.

The parameters \(a\) and \(b\) cannot be arbitrary: \(\Sigma(a,b)\) must be positive definite. In the direction of \(\mathbf{1}\), its eigenvalue is \(a+(p-1)b\); in each of the \(p-1\) directions perpendicular to \(\mathbf{1}\), its eigenvalue is \(a-b\). Thus the precise constraints are

$$ a+(p-1)b>0,\qquad a-b>0. $$

Equivalently, the null covariance has two distinct eigenvalues, one for the direction of the common component and one shared by all contrasts. This representation makes the constrained likelihood calculation direct. It also makes clear that compound symmetry is not the same as requiring all components of \(\mu\) to be equal.

Deriving the Likelihood-Ratio Statistic

For either hypothesis, maximizing the Gaussian likelihood over the unrestricted mean gives \(\hat\mu=\bar X\). Up to terms common to both hypotheses, the resulting log-likelihood is

$$ \ell(\Sigma)=-\frac{n}{2}\left\{\log|\Sigma|+\operatorname{tr}(S\Sigma^{-1})\right\}. $$

Introduce the orthogonal projectors

$$ P=\frac{\mathbf{1}\mathbf{1}'}{p},\qquad Q=I_p-P, \qquad u=\operatorname{tr}(SP)=\frac{\mathbf{1}'S\mathbf{1}}{p}, \qquad v=\operatorname{tr}(SQ)=\operatorname{tr}(S)-u. $$

The matrix \(P\) projects onto the span of \(\mathbf{1}\), while \(Q\) projects onto its orthogonal complement. Write the two eigenvalues of a compound-symmetry covariance as \(\lambda_1=a+(p-1)b\) and \(\lambda_0=a-b\). Then \(\Sigma=\lambda_1P+\lambda_0Q\), and its determinant and inverse are

$$ |\Sigma|=\lambda_1\lambda_0^{p-1}, \qquad \Sigma^{-1}=\lambda_1^{-1}P+\lambda_0^{-1}Q. $$

Using \(P^2=P\), \(Q^2=Q\), and \(\operatorname{tr}(PQ)=0\), the part of the negative log-likelihood that depends on these eigenvalues is proportional to

$$ \log\lambda_1+\frac{u}{\lambda_1} +(p-1)\log\lambda_0+\frac{v}{\lambda_0}. $$

Because \(S\) is positive definite, \(u>0\) and \(v>0\). For any \(c>0\), the function \(g(\lambda)=\log\lambda+c/\lambda\), for \(\lambda>0\), has derivative \(g'(\lambda)=(\lambda-c)/\lambda^2\). It decreases up to \(c\), increases after \(c\), and tends to infinity at either endpoint of its domain. Applying this to each eigenvalue gives the constrained estimates.

Result: Under compound symmetry, $$ \hat\lambda_1=u,\qquad \hat\lambda_0=\frac{v}{p-1}, $$ and hence $$ \hat b=\frac{u-v/(p-1)}{p}, \qquad \hat a=\frac{u+(p-1)\{v/(p-1)\}}{p} =\frac{u+v}{p}. $$ These estimates satisfy the positive-definiteness constraints because both fitted eigenvalues are positive.

Under the unrestricted alternative, the maximum-likelihood estimate is \(S\). To see why, compare the objective at an arbitrary positive-definite \(\Sigma\) with its value at \(S\). Let \(t_1,\ldots,t_p\) be the positive eigenvalues of \(S^{-1/2}\Sigma S^{-1/2}\). The difference is

$$ \log|\Sigma|+\operatorname{tr}(S\Sigma^{-1}) -\log|S|-p =\sum_{j=1}^p\left(\log t_j+\frac{1}{t_j}-1\right)\geq 0. $$

Indeed, each summand is nonnegative: the function \(h(t)=\log t+1/t-1\) has derivative \((t-1)/t^2\) and its minimum is \(h(1)=0\). Equality holds only when every \(t_j=1\), or \(\Sigma=S\). This proves the unrestricted maximum-likelihood claim.

At either fitted covariance, \(\operatorname{tr}(S\hat\Sigma^{-1})=p\): under the null this is \(u/u+v/(v/(p-1))=1+(p-1)\), and under the alternative it is \(\operatorname{tr}(I_p)=p\). Therefore the likelihood-ratio statistic has the following form.

Theorem: With \(\Lambda\) defined as the maximized likelihood under \(H_0\) divided by the maximized likelihood under \(H_1\), $$ -2\log\Lambda =n\log\left(\frac{|\hat\Sigma_0|}{|S|}\right) =n\log\left\{ \frac{u\left(v/(p-1)\right)^{p-1}}{|S|} \right\}, $$ where \(\hat\Sigma_0=\hat\lambda_1P+\hat\lambda_0Q\). The statistic is nonnegative because the constrained maximum cannot exceed the unrestricted maximum.

Degrees of Freedom and Calibration

An unrestricted symmetric covariance matrix has \(p(p+1)/2\) free parameters. Compound symmetry has two: \(a\) and \(b\), or, equivalently, \(\lambda_1\) and \(\lambda_0\). The mean vector contributes \(p\) nuisance parameters under both hypotheses, so it does not change the difference in covariance dimensions. The null parameter region is open under the two strict positive-definiteness inequalities, so it has dimension two. The difference in dimensions is therefore

$$ \nu=\frac{p(p+1)}{2}-2. $$

Under \(H_0\), for fixed \(p\), as \(n\) grows, the standard Wilks calibration gives \(-2\log\Lambda\xrightarrow{d}\chi^2_{\nu}\), provided the true covariance is positive definite and lies in the interior of the compound-symmetry parameter space. This is a large-sample approximation, not an exact finite-sample chi-square distribution. The test rejects for a large value of the statistic, comparing it with the upper tail of the chi-square distribution with \(\nu\) degrees of freedom.

Worked Calculations

Worked Example: A Three-Variable Test

Suppose \(p=3\), \(n=40\), and the observed maximum-likelihood-scaled sample covariance is $$ S= \begin{pmatrix} 4&1&0.5\\ 1&9&2\\ 0.5&2&16 \end{pmatrix}. $$ Its determinant is \(4(9\cdot16-2^2)-1(1\cdot16-2\cdot0.5)+0.5(1\cdot2-9\cdot0.5)=543.75\), which is positive.

The trace is \(29\), and the sum of all entries is \(29+2(1+0.5+2)=36\). Thus \(u=36/3=12\) and \(v=29-12=17\). The fitted eigenvalues are \(\hat\lambda_1=12\) and \(\hat\lambda_0=17/2=8.5\). Converting to the covariance parameters gives $$ \hat b=\frac{12-8.5}{3}=\frac{7}{6}, \qquad \hat a=\frac{12+2(8.5)}{3}=\frac{29}{3}. $$

The fitted null determinant is \(12(8.5)^2=867\). Hence $$ -2\log\Lambda=40\log\left(\frac{867}{543.75}\right) =40\log\left(\frac{1156}{725}\right)\approx18.66. $$ For \(p=3\), the degrees of freedom are \(3(4)/2-2=4\). The asymptotic calibration uses a chi-square distribution with four degrees of freedom.

Worked Example: The Two-Variable Case

Let \(p=2\), \(n=30\), and \(S=\begin{pmatrix}4&1\\1&9\end{pmatrix}\). Here \(\operatorname{tr}(S)=13\), the sum of all entries is \(15\), so \(u=15/2=7.5\) and \(v=13-7.5=5.5\). The two fitted eigenvalues are \(7.5\) and \(5.5\).

For \(p=2\), these correspond to \(\hat a=(7.5+5.5)/2=6.5\) and \(\hat b=(7.5-5.5)/2=1\). The null determinant is \(7.5\cdot5.5=41.25\), whereas \(|S|=4\cdot9-1=35\). Consequently, $$ -2\log\Lambda=30\log\left(\frac{41.25}{35}\right) =30\log\left(\frac{33}{28}\right)\approx4.93. $$ There are \(2(3)/2-2=1\) degrees of freedom. This case also illustrates that compound symmetry for two variables imposes one covariance restriction: the two variances must be equal.

Worked Example: Unequal Sample Variances With Zero Sample Covariances

Take \(p=4\), \(n=25\), and \(S=\operatorname{diag}(1,4,9,16)\). The trace is \(30\) and \(\mathbf{1}'S\mathbf{1}=30\), so \(u=30/4=7.5\) and \(v=30-7.5=22.5\). Therefore \(\hat\lambda_1=7.5\) and \(\hat\lambda_0=22.5/3=7.5\), giving \(\hat a=7.5\) and \(\hat b=0\).

The constrained fit is \(7.5I_4\), with determinant \(7.5^4=3164.0625\). The unrestricted determinant is \(1\cdot4\cdot9\cdot16=576\). Thus $$ -2\log\Lambda =25\log\left(\frac{3164.0625}{576}\right) \approx42.58. $$ The degrees of freedom are \(4(5)/2-2=8\). The diagonal sample covariance does not itself satisfy compound symmetry, because its diagonal entries differ; the constrained fit pools them into a common variance.

Interpretation and a Common Pitfall

The test evaluates whether the observed covariance structure can be represented by two common parameters instead of \(p(p+1)/2\) free entries. A large statistic indicates that this reduction in dimension substantially worsens the maximized likelihood. The fitted \(a\) and \(b\) describe the constrained covariance estimate; they should not be confused with parameters estimated from an unrestricted covariance model.

  • Wrong reasoning: “Compound symmetry has only one parameter, because every covariance entry is the same.” This overlooks that the diagonal entries and off-diagonal entries are generally different from each other.
  • Correction: There is one common diagonal value \(a\) and one common off-diagonal value \(b\), so the null covariance has two free parameters. Subtract two—not one—from the unrestricted covariance dimension to obtain the degrees of freedom.
  • Another source of error: Using a covariance matrix divided by \(n-1\) in the likelihood formula while retaining the factor \(n\). The formulas here use \(S\) divided by \(n\); a differently scaled matrix must be converted consistently.
Key takeaway: Under compound symmetry, fit the common-direction eigenvalue with \(u\), and the contrast-direction eigenvalue with \(v/(p-1)\). The likelihood-ratio statistic compares the determinant of that fitted covariance with \(|S|\), and its Wilks degrees of freedom are \(p(p+1)/2-2\).

Check Your Understanding

Use the definitions and derivations above to answer these questions.

  1. State the two strict positive-definiteness conditions for compound-symmetry parameters \(a\) and \(b\).
  2. For \(p=5\), how many covariance parameters are in the unrestricted model, and how many degrees of freedom does the likelihood-ratio test have?
  3. Why does the unknown mean vector not add to the difference in degrees of freedom?
  4. For a positive-definite \(S\), explain why both constrained fitted eigenvalues are positive.
  5. Why is the chi-square calibration described as asymptotic rather than exact?
Clinical Biostats