Tutorials › Multivariate Statistics (Graduate) › Worked Test Of A Specified Covariance

Covariance Matrix Inference · Tutorial 242 of 975

Worked Test Of A Specified Covariance

Calculate and interpret a Bartlett-corrected likelihood-ratio test of a specified covariance matrix when the multivariate normal mean is unknown.

Intermediate 11 min read

What You'll Learn

  • Express the specified-covariance likelihood-ratio statistic using the sample scatter matrix
  • Identify the chi-square degrees of freedom for a fully specified covariance matrix
  • Apply the Bartlett multiplier for an unknown mean
  • Calculate raw and corrected chi-square p-values
  • Check the normality, rank, and sample-size conditions behind the test
  • Interpret a nonsignificant result without treating it as proof of the null hypothesis

What the Test Compares

A covariance matrix is a joint description of marginal variances and pairwise covariances. A scientific question may specify a complete covariance matrix in advance—for example, whether a set of measurements has the covariance structure predicted by a measurement model. The likelihood-ratio test compares that specified matrix with the best-fitting unrestricted covariance matrix, while allowing the mean vector to be unknown.

The test here is for independent observations from a multivariate normal distribution. Its statistic measures how much the likelihood improves when the covariance is allowed to vary freely. Under the null hypothesis, the statistic is calibrated approximately by a chi-square distribution. A Bartlett correction adjusts the statistic for a leading finite-sample discrepancy; it does not make the test exact.

Model and hypotheses: Suppose \(X_1,\ldots,X_n\) are independent and identically distributed \(p\)-variate normal random vectors, with unknown mean \(\mu\) and positive-definite covariance matrix \(\Sigma\). The specified-covariance test has null hypothesis \(H_0:\Sigma=\Sigma_0\), where \(\Sigma_0\) is a known positive-definite matrix, against the unrestricted alternative that \(\Sigma\) is any positive-definite matrix. The mean remains unrestricted under both hypotheses.

The Statistic from the Sample Scatter Matrix

Write \(\bar X=n^{-1}\sum_{i=1}^n X_i\) for the sample mean and define the centered scatter matrix

$$ A=\sum_{i=1}^n (X_i-\bar X)(X_i-\bar X)'. $$

Assume \(n>p\) and that \(A\) is positive definite. This ensures the unrestricted covariance maximum-likelihood estimate, \(A/n\), exists and is positive definite. The factor \(n\), rather than \(n-1\), is used because this is the maximum-likelihood estimate after fitting the mean.

Likelihood-ratio statistic: For testing \(H_0:\Sigma=\Sigma_0\), with the mean unknown and estimated under both hypotheses, the statistic is
$$ T=-2\log\Lambda =\operatorname{tr}(\Sigma_0^{-1}A) -n\log\left|\Sigma_0^{-1/2}(A/n)\Sigma_0^{-1/2}\right|-np. $$
Here \(\Lambda\) is the maximized likelihood under the null divided by the maximized likelihood under the unrestricted alternative.

To see where this expression comes from, the normal log-likelihood, apart from its constant term, is \(\ell(\mu,\Sigma)=-\tfrac n2\log|\Sigma|-\tfrac12\sum_i(X_i-\mu)'\Sigma^{-1}(X_i-\mu)\). For either hypothesis, maximizing over \(\mu\) gives \(\bar X\), leaving the quadratic term \(\operatorname{tr}(\Sigma^{-1}A)\). Under the null the covariance is \(\Sigma_0\); under the unrestricted alternative its maximum-likelihood estimate is \(A/n\). Therefore

$$ \begin{aligned} -2\log\Lambda &= n\log|\Sigma_0|+\operatorname{tr}(\Sigma_0^{-1}A) -n\log|A/n|-np\\ &=\operatorname{tr}(\Sigma_0^{-1}A) -n\log\left|\Sigma_0^{-1/2}(A/n)\Sigma_0^{-1/2}\right|-np. \end{aligned} $$

The second equality uses the determinant identity \(\left|\Sigma_0^{-1/2}(A/n)\Sigma_0^{-1/2}\right|=|A/n|/|\Sigma_0|\). The trace and determinant terms compare the observed scatter with the specified covariance on the same scale.

Worked Example: A Two-Variable Scatter Matrix

Suppose \(p=2\), \(n=20\), \(\Sigma_0=I_2\), and the observed scatter matrix is \(A=\operatorname{diag}(24,16)\). Calculate the raw likelihood-ratio statistic and its Bartlett-corrected version.

The scaled scatter matrix is \(A/n=\operatorname{diag}(1.2,0.8)\), with trace \(2\) and determinant \(0.96\). Since \(\Sigma_0=I_2\),

$$ T=20-\;20\log(0.96)-40=-20\log(0.96)=0.8164. $$

There are \(q=p(p+1)/2=3\) free covariance parameters. For an unknown mean, the Bartlett multiplier is \(c=1-(2p^2+9p+11)/(6(p+1)n)\). Here, \(c=1-37/(6\cdot3\cdot20)=0.8972\), so the corrected statistic is \(T_B=cT=0.7325\). Its approximate reference distribution is \(\chi^2_3\); the upper-tail p-value is about \(0.87\). At the 5% level, this is not evidence against the specified covariance.

Chi-Square Calibration and the Bartlett Correction

The number of unrestricted covariance parameters is \(q=p(p+1)/2\), because a symmetric \(p\times p\) matrix has \(p\) diagonal entries and \(p(p-1)/2\) distinct off-diagonal entries. Under the null and standard regularity conditions, Wilks’ theorem gives a chi-square limit with this many degrees of freedom. Here the conditions include fixed \(p\), independent observations from the stated normal model, a positive-definite null covariance, and an identifiable unrestricted covariance model.

Wilks calibration and Bartlett adjustment: Under \(H_0\), as \(n\) increases with \(p\) fixed, \(T\xrightarrow{d}\chi^2_q\), where \(q=p(p+1)/2\). For the specified-covariance test with an unknown mean, use the Bartlett-adjusted statistic
$$ T_B=cT,\qquad c=1-\frac{2p^2+9p+11}{6(p+1)n}. $$
The usual finite-sample approximation compares \(T_B\), not \(T\), with \(\chi^2_q\). The correction is an asymptotic refinement, not an exact null distribution.

The form of the correction depends on estimating the mean. A derivation of its leading term helps explain both the multiplier and its limitations. Under \(H_0\), the transformed scatter matrix \(W=\Sigma_0^{-1/2}A\Sigma_0^{-1/2}\) has a Wishart distribution with identity scale and \(n-1\) degrees of freedom. The statistic can be written \(T=\operatorname{tr}(W)-n\log|W|+np\log n-np\). For this Wishart distribution, \(E[\operatorname{tr}(W)]=p(n-1)\) and \(E[\log|W|]=p\log 2+\sum_{j=1}^p\psi((n-j)/2)\), where \(\psi\) is the digamma function.

Derivation of the leading mean correction: For fixed \(p\), the digamma expansion \(\psi(z)=\log z-\frac{1}{2z}-\frac{1}{12z^2}+O(z^{-4})\) gives
$$ \psi((n-j)/2)+\log 2 =\log n-\frac{j+1}{n} -\frac{j^2/2+j+1/3}{n^2}+O(n^{-3}). $$
Summing over \(j=1,\ldots,p\) and substituting into the Wishart expectations yields
$$ \begin{aligned} E[T] &=q+\frac{1}{n}\sum_{j=1}^p\left(\frac{j^2}{2}+j+\frac13\right)+O(n^{-2})\\ &=q+\frac{p(2p^2+9p+11)}{12n}+O(n^{-2}). \end{aligned} $$
Since \(q=p(p+1)/2\), the relative leading excess over \(q\) is \((2p^2+9p+11)/(6(p+1)n)\). Multiplying by one minus this quantity removes that leading mean discrepancy. The Bartlett refinement uses this first-order adjustment in the chi-square calibration; matching the mean alone is not a claim that the finite-sample distribution is exactly chi-square. \(\square\)

Worked Example: A Three-Variable Test and Its Corrected P-Value

Suppose \(p=3\), \(n=100\), \(\Sigma_0=I_3\), and the scaled scatter matrix is \(A/n=\operatorname{diag}(e^x,1,1)\), where \(x\) is the positive solution of \(100(e^x-x-1)=6.6167\) (approximately \(x=0.3430\)). Calculate both chi-square p-values.

The trace of \(A/n\) is \(e^x+2\), and its log determinant is \(x\). Thus \(T=100[(e^x+2)-x-3]=100(e^x-x-1)=6.6167\). The degrees of freedom are \(q=3(4)/2=6\). The uncorrected upper-tail probability is \(P(\chi^2_6\ge 6.6167)\approx0.3578\).

For \(p=3\), the correction is \(c=1-56/(24n)\). With \(n=100\), this is \(c=0.9766667\), giving \(T_B=0.9766667(6.6167)=6.4623\). The corrected upper-tail probability is \(P(\chi^2_6\ge 6.4623)\approx0.3734\). Both p-values exceed \(0.05\), so this sample does not provide evidence against the specified covariance at that level. The conclusion is not that the null covariance has been proved true.

Reading the Result Carefully

For a chosen significance level \(\alpha\), reject \(H_0\) when the corrected p-value is at most \(\alpha\), or equivalently when \(T_B\) exceeds the \(1-\alpha\) quantile of \(\chi^2_q\). The p-value is calculated from the upper tail because larger likelihood-ratio values indicate greater disagreement between the data and the null covariance. The chi-square calibration is approximate, so its quality can be affected by small samples, high dimension, departures from multivariate normality, or observations that strongly influence the scatter matrix.

Worked Example: A Small Sample and a Cautious Conclusion

Let \(p=3\), \(n=8\), \(\Sigma_0=I_3\), and suppose \(A/n=\operatorname{diag}(1.5,1,0.75)\). The scatter is positive definite and \(n>p\). Calculate the adjusted statistic and interpret it.

The trace is \(3.25\), and the determinant is \(1.5(1)(0.75)=1.125\). Therefore \(T=8[3.25-\log(1.125)-3]\). Since \(\log(1.125)\approx0.117783\), \(T\approx8(0.132217)=1.0577\).

For \(p=3,n=8\), \(c=1-7/(3\cdot8)=17/24\approx0.7083\). Thus \(T_B\approx0.7492\), with \(6\) chi-square degrees of freedom. The approximate upper-tail p-value is about \(0.993\), so the test does not reject at the 5% level. The sample is small, however, and the large p-value is not evidence that the covariance is exactly \(I_3\); it indicates that this test statistic is not unusually large under its approximate reference distribution.

Common Mistakes

  • Using the wrong scatter scaling. The likelihood uses \(A/n\), the maximum-likelihood estimate after estimating the mean. Replacing it silently with \(A/(n-1)\) changes the likelihood-ratio statistic.
  • Using the correction for a different model. Estimating the mean changes the finite-sample correction. Use the multiplier stated here for an unknown mean, rather than one derived for a known mean.
  • Reporting the wrong chi-square tail. The p-value is \(P(\chi^2_q\ge T_B)\), not the lower-tail probability.
  • Treating the correction as an exact distributional result. The adjusted statistic still uses an approximate chi-square calibration. The correction improves the leading finite-sample approximation but does not remove model assumptions.
  • Interpreting nonrejection as confirmation. A nonsignificant result means the data do not provide sufficient evidence against the specified matrix at the chosen level; it does not establish that the matrix is correct.
Key takeaway: Compute the likelihood-ratio statistic from the centered scatter matrix using the maximum-likelihood scaling \(A/n\). Multiply by the Bartlett factor for an unknown mean, compare the result with \(\chi^2_{p(p+1)/2}\), and report the conclusion as approximate and conditional on the model.

Check Your Understanding

Use the definitions and calculations above to answer the following.

  1. Why does the likelihood-ratio statistic use \(A/n\) rather than the unbiased sample covariance \(A/(n-1)\)?
  2. For \(p=4\), how many degrees of freedom does the chi-square reference distribution have?
  3. In the three-variable example with raw statistic \(6.6167\), why is the corrected p-value calculated using \(6.4623\) rather than \(6.6167\)?
  4. What assumptions justify using the stated chi-square calibration?
  5. Explain why a p-value of \(0.87\) does not prove that the specified covariance matrix is true.
Clinical Biostats