Why Estimate Covariance in a Mean Test?
A test of a multivariate mean asks whether a population mean vector equals a specified vector. When the population covariance matrix is known, the displacement between the sample mean and the specified mean can be standardized using that matrix. In practice, the covariance is often unknown and must be estimated from the same sample. Hotelling’s \(T^2\) is the resulting one-sample statistic: it measures the sample mean’s squared displacement from the specified value relative to the observed covariance.
The statistic is a single joint measure. It accounts for the scales of the variables and their correlations, rather than testing each coordinate separately. Its construction is simple, but its use depends on an important dimension condition: the sample covariance must be invertible. Exact finite-sample inference also relies on a sampling model, which must be kept distinct from the algebraic definition of the statistic.
Definition and Conditions
The factor \(n\) is part of the definition. The covariance matrix of the sample mean, when the population covariance is \(\Sigma\), is \(\Sigma/n\); accordingly, the factor \(n\) scales the squared mean displacement to the scale of a single observation’s covariance. The matrix inverse combines all coordinates, including their associations.
For this tutorial’s exact finite-sample testing interpretation, assume \(X_i\sim N_p(\mu,\Sigma)\) independently, where \(\Sigma\) is positive definite. The statistic itself can be calculated for other data whenever \(S\) is invertible, but the Gaussian exact calibration does not automatically apply to nonnormal data. The Gaussian model and the null hypothesis \(H_0:\mu=\mu_0\) specify the setting in which the statistic is used for exact inference.
Why the Sample-Size Condition Is Necessary
Arrange the centered observations as the rows of an \(n\)-by-\(p\) matrix \(Y\), with row \(i\) equal to \((X_i-\bar X)'\). Then \(S=Y'Y/(n-1)\). Since the rows of \(Y\) sum to zero, they are linearly dependent whenever \(n>0\), and \(\operatorname{rank}(Y)\le n-1\). Also, \(Y\) has only \(p\) columns. Therefore $$ \operatorname{rank}(S)=\operatorname{rank}(Y'Y)=\operatorname{rank}(Y)\le \min(p,n-1). $$ If \(n\le p\), this upper bound is at most \(p-1\), so \(S\) cannot have rank \(p\) and cannot be inverted.
For the sufficiency claim under the stated Gaussian model, choose an \(n\)-by-\((n-1)\) matrix \(Q\) whose columns are an orthonormal basis for the subspace perpendicular to the all-ones vector. The matrix \(Q'Y\) has \(n-1\) rows and \(p\) columns; under Gaussian sampling, its rows are independent \(N_p(0,\Sigma)\) vectors. If \(n-1\ge p\), these rows have a joint density, and the first \(p\) rows form a nonsingular \(p\)-by-\(p\) matrix with probability one. Indeed, its determinant is a nonzero polynomial in continuously distributed entries, whose zero set has probability zero. Hence \(Q'Y\), and therefore \(Y\), has rank \(p\) with probability one. This proves the stated condition. \(\square\)
Worked Calculations
Worked Example: A One-Dimensional Mean Test
Suppose \(n=4\) observations are \(1,2,4,5\), and the specified mean is \(\mu_0=1.5\). Calculate \(T^2\).
The sample mean is $$ \bar X=\frac{1+2+4+5}{4}=3. $$ The centered observations are \(-2,-1,1,2\), so the unbiased sample variance is $$ S=\frac{(-2)^2+(-1)^2+1^2+2^2}{4-1} =\frac{10}{3}. $$ Since \(p=1\), the covariance matrix is just this scalar variance. Therefore $$ T^2=4\frac{(3-1.5)^2}{10/3} =4\frac{2.25}{10/3} =4(0.675) =2.7. $$ The statistic is \(2.7\), not \(2.25\): the squared difference is \(2.25\), but it must still be divided by the sample variance and multiplied by \(n\). In one dimension, \(T^2\) equals the square of the usual one-sample \(t\)-statistic, because both use \(\sqrt{n}(\bar X-\mu_0)/\sqrt{S}\) before squaring.
Worked Example: A Two-Dimensional Test
Consider five observations in two dimensions: $$ (3,2),\quad (1,2),\quad (2,-1),\quad (2,1),\quad (2,1), $$ and test the specified mean \(\mu_0=(1,0)'\). Compute \(T^2\), without assigning a \(p\)-value.
The coordinate means are \(\bar X=(2,1)'\). The centered observations are \((1,1),(-1,1),(0,-2),(0,0),(0,0)\). Summing their outer products gives $$ \sum_{i=1}^5(X_i-\bar X)(X_i-\bar X)' = \begin{pmatrix}2&0\\0&6\end{pmatrix}, \qquad S=\frac{1}{4}\begin{pmatrix}2&0\\0&6\end{pmatrix} = \begin{pmatrix}1/2&0\\0&3/2\end{pmatrix}. $$ Thus \(S^{-1}=\begin{pmatrix}2&0\\0&2/3\end{pmatrix}\), and \(\bar X-\mu_0=(1,1)'\). Substitution gives $$ T^2=5 \begin{pmatrix}1&1\end{pmatrix} \begin{pmatrix}2&0\\0&2/3\end{pmatrix} \begin{pmatrix}1\\1\end{pmatrix} =5\left(2+\frac{2}{3}\right) =\frac{40}{3}. $$ Here \(n=5>p=2\), so the sample covariance is invertible. The statistic summarizes the joint discrepancy from \((1,0)'\); deciding whether that discrepancy is significant requires comparison with the appropriate null critical value.
Worked Example: When the Dimension Condition Fails
Suppose there are \(n=3\) observations in \(p=3\) dimensions. Can the one-sample Hotelling statistic be formed using the sample covariance?
The centered data matrix has three rows, but those rows sum to zero. Its rank is therefore at most \(3-1=2\). Since it has three columns, it cannot have rank three. Consequently \(S=Y'Y/2\) is singular, so \(S^{-1}\) does not exist and the stated \(T^2\) statistic cannot be computed. This is not repaired by choosing a different \(\mu_0\); the obstacle is the covariance estimate’s rank. A different method for singular sample covariance matrices is a separate problem.
Using \(T^2\) to Test a Specified Mean
The one-sample null and alternative are $$ H_0:\mu=\mu_0 \qquad\text{versus}\qquad H_A:\mu\ne\mu_0. $$ Under the Gaussian model and \(n>p\), compute \(T^2\) from the observed sample. Large values indicate that the sample mean is far from \(\mu_0\) relative to the estimated covariance, and therefore provide evidence against \(H_0\). For a test of size \(\alpha\), reject when \(T^2\) exceeds the upper-tail critical value from its null distribution for the given \(n\) and \(p\). The exact conversion to an \(F\) reference distribution is developed in the subsequent calibration material; it should not be replaced by an unqualified chi-square reference in a finite sample.
This decision rule uses the joint pattern of deviations. For instance, if the variables are correlated, a displacement along a direction in which observations naturally vary substantially is treated differently from an equally long displacement in a direction with little natural variation. This is why the inverse covariance matrix appears in the quadratic form.
Common Mistakes and Practical Interpretation
- Using the wrong covariance divisor. The definition here uses \(n-1\), the unbiased sample covariance. Replacing it with a covariance divided by \(n\) changes the statistic.
- Forgetting the factor \(n\). The statistic is \(n(\bar X-\mu_0)'S^{-1}(\bar X-\mu_0)\), not just the quadratic form without \(n\).
- Checking only that there are observations. For \(p\) variables, one needs \(n>p\), and with arbitrary data one must also check that the centered observations span all \(p\) dimensions.
- Testing coordinates one at a time and calling that the same procedure. Separate tests do not, by themselves, provide the same joint test; they do not use the full covariance structure in a single statistic.
- Applying a Gaussian exact calibration without its assumptions. The formula for \(T^2\) may be calculable for nonnormal observations, but its exact finite-sample reference distribution requires the specified Gaussian sampling model.
The practical value of Hotelling’s statistic is that a vector-valued mean hypothesis becomes one covariance-adjusted test. Its computation requires the sample mean, the unbiased sample covariance, and an invertible covariance estimate. Its interpretation then depends on the null distribution appropriate to the model and the sample dimensions.
Check Your Understanding
Work through these questions to check the definition, conditions, and interpretation.
- Write the one-sample Hotelling statistic and identify the divisor used in the sample covariance matrix.
- For \(n=8\) observations on \(p=8\) variables, explain why the sample covariance cannot be inverted.
- Under what sampling assumptions is \(n>p\) sufficient for invertibility with probability one?
- In a one-dimensional test, why does Hotelling’s \(T^2\) equal the squared one-sample \(t\)-statistic?
- What does a large value of \(T^2\) indicate about the sample mean relative to the specified mean?