Skip to content

High-dimensional mean test

Compare many means without inverting a noisy covariance matrix. Work through the Chen–Qin raw U statistic and see what is still needed for valid inference.

A high-dimensional mean test tests a population mean vector when the number of coordinates is large relative to the sample size. For a quant comparing average pricing errors across hundreds of instruments in two periods, the challenge is to distinguish a joint mean shift from sampling noise without relying on an unstable covariance inverse. This article develops the independent two-sample Chen–Qin construction.

Why the inverse becomes the obstacle

The classical two-sample version of the Hotelling T-squared test scales the mean difference by an inverse pooled covariance matrix. Stanford's notes give this construction and its normal-theory calibration.

With sample sizes n1,n2n_1,n_2, the pooled covariance has rank at most n1+n2−2n_1+n_2-2: centring removes one independent row from each group. If p>n1+n2−2p>n_1+n_2-2, inversion is impossible. For example, 120 observations in one group and 100 in the other can give rank at most 218, insufficient for 500 coordinates. Even before that boundary, nearly redundant coordinates can make inversion sensitive to small data changes.

A pseudoinverse does not restore the classical reference law. It selects a different distance, with its own inference problem.

Estimate the squared mean gap directly

Let X1,…,Xn1\mathbf X_1,\ldots,\mathbf X_{n_1} and Y1,…,Yn2\mathbf Y_1,\ldots,\mathbf Y_{n_2} be independent samples, with n1,n2≥2n_1,n_2\ge2, each i.i.d. within its group, with means μX,μY\boldsymbol\mu_X,\boldsymbol\mu_Y and finite covariance matrices ΣX,ΣY\Sigma_X,\Sigma_Y. Coordinates within a row may be correlated; the two covariance matrices need not be equal. Test

H0:μX=μYagainstH1:μX≠μY.H_0:\boldsymbol\mu_X=\boldsymbol\mu_Y \quad\text{against}\quad H_1:\boldsymbol\mu_X\ne\boldsymbol\mu_Y.

The raw Chen–Qin statistic is

U=∑i≠jXi⊤Xjn1(n1−1)+∑i≠jYi⊤Yjn2(n2−1)−2∑i=1n1∑j=1n2Xi⊤Yjn1n2.U= \frac{\sum_{i\ne j}\mathbf X_i^\top\mathbf X_j}{n_1(n_1-1)} +\frac{\sum_{i\ne j}\mathbf Y_i^\top\mathbf Y_j}{n_2(n_2-1)} -\frac{2\sum_{i=1}^{n_1}\sum_{j=1}^{n_2}\mathbf X_i^\top\mathbf Y_j}{n_1n_2}.
The within-group sums use ordered pairs of distinct observations. Independence gives E[Xi⊤Xj]=μX⊤μX\mathbb E[\mathbf X_i^\top\mathbf X_j]=\boldsymbol\mu_X^\top\boldsymbol\mu_X for i≠ji\ne j. Therefore
E[U]=∥μX−μY∥2.\mathbb E[U]=\lVert\boldsymbol\mu_X-\boldsymbol\mu_Y\rVert^2.

An equivalent identity explains the noise correction. Let SX,SYS_X,S_Y be the sample covariances with denominators n1−1,n2−1n_1-1,n_2-1. Then

U=∥Xˉ−Yˉ∥2−tr⁡(SX)n1−tr⁡(SY)n2.U=\lVert\bar{\mathbf X}-\bar{\mathbf Y}\rVert^2 -\frac{\operatorname{tr}(S_X)}{n_1} -\frac{\operatorname{tr}(S_Y)}{n_2}.
The matrix trace adds the coordinate variances. The uncorrected squared sample-mean gap includes both the population gap and the noise in estimating those means. Removing an unbiased estimate of that noise can produce a negative UU; the population squared gap remains nonnegative.

A tiny example, with no p-value attached

Take fictional pricing-error vectors in basis points:

X:(2,0), (3,1), (1,2),Y:(0,0), (0,1), (1,0).\begin{aligned} X &: (2,0),\ (3,1),\ (1,2),\\ Y &: (0,0),\ (0,1),\ (1,0). \end{aligned}

Here n1=n2=3n_1=n_2=3, p=2p=2, Xˉ=(2,1)⊤\bar{\mathbf X}=(2,1)^\top and Yˉ=(1/3,1/3)⊤\bar{\mathbf Y}=(1/3,1/3)^\top. The six ordered off-diagonal dot products in XX sum to 2626; those in YY sum to zero. The cross-group term is 2Xˉ⊤Yˉ=22\bar{\mathbf X}^\top\bar{\mathbf Y}=2. Hence

U=266+0−2=73≈2.3333 bp2.U=\frac{26}{6}+0-2=\frac73\approx2.3333\ \text{bp}^2.

Independently, the squared sample-mean gap is 29/929/9, while tr⁡(SX)=2\operatorname{tr}(S_X)=2 and tr⁡(SY)=2/3\operatorname{tr}(S_Y)=2/3. The identity gives 29/9−2/3−2/9=7/329/9-2/3-2/9=7/3 again.

Fictional two-coordinate data with three observations per group. Squared sample-mean distance 29/9, minus X correction 2/3, minus Y correction 2/9, gives raw U of 7/3 squared basis points. No p-value is calculated.
Fictional two-coordinate data with three observations per group. Squared sample-mean distance 29/9, minus X correction 2/3, minus Y correction 2/9, gives raw U of 7/3 squared basis points. No p-value is calculated.

Sampling noise contributes to the observed squared gap. Subtracting its estimated contribution gives the raw Chen–Qin U statistic; the tiny example demonstrates arithmetic, not high-dimensional inference.

Turning the estimate into a test

Under H0H_0, the variance is

v0=2tr⁡(ΣX2)n1(n1−1)+2tr⁡(ΣY2)n2(n2−1)+4tr⁡(ΣXΣY)n1n2.v_0= \frac{2\operatorname{tr}(\Sigma_X^2)}{n_1(n_1-1)} +\frac{2\operatorname{tr}(\Sigma_Y^2)}{n_2(n_2-1)} +\frac{4\operatorname{tr}(\Sigma_X\Sigma_Y)}{n_1n_2}.
Inference needs a ratio-consistent estimator v^0\hat v_0 and a valid central limit theorem, giving U/v^0⇒N(0,1)U/\sqrt{\hat v_0}\Rightarrow\mathcal N(0,1) under the null. Reject in the upper tail, above the standard-normal (1−α)(1-\alpha) quantile for asymptotic level α\alpha. Chen–Qin uses specifically constructed trace estimators; arbitrary covariance plug-ins are not justified automatically.

Their Theorems 1–2 require growing samples and dimension, balanced sample-size proportions, a linear latent-variable model with moment restrictions, and covariance trace conditions. For equal covariances, a key restriction is

tr⁡(Σ4){tr⁡(Σ2)}2⟶0.\frac{\operatorname{tr}(\Sigma^4)}{\{\operatorname{tr}(\Sigma^2)\}^2}\longrightarrow0.

A dominant covariance direction can violate it. Their local-alternative regime requires, writing δ=μX−μY\boldsymbol\delta=\boldsymbol\mu_X-\boldsymbol\mu_Y and N=n1+n2N=n_1+n_2,

δ⊤Σiδ=o ⁣(tr⁡{(ΣX+ΣY)2}N),i=X,Y.\boldsymbol\delta^\top\Sigma_i\boldsymbol\delta =o\!\left(\frac{\operatorname{tr}\{(\Sigma_X+\Sigma_Y)^2\}}{N}\right), \qquad i=X,Y.
Under stronger alternatives, signal-dependent variance can matter. Large dimension alone guarantees neither normality nor statistical power. See Section 3 for the precise assumptions, variance estimators and rejection rule.
The n=3,p=2n=3,p=2 example establishes none of those asymptotic conditions. Its 7/37/3 is a raw estimate with units, not a standardised score or p-value.

What the result would mean on a desk

The target is a joint mean difference, not equality of whole distributions. A rejection does not identify the affected instruments. Subsequent coordinate searches create a multiple-testing problem.

The Euclidean target also makes units consequential: changing one coordinate from basis points to percent changes its weight. Any prespecified rescaling defines a new target and must fit the inference assumptions. Adding unrelated coordinates adds noise; the number of columns is not a measure of usable evidence.

Daily errors can be serially dependent, and running two models on the same dates creates paired observations. Neither design satisfies the independent two-sample setup above. The relevant sampling variance and calibration must match the actual design.

For the distinction between estimates, tests and power, see Confidence Intervals and Hypothesis Testing (public preview; full lesson requires membership).

Sources

Last updated
  • high dimensional statistics
  • mean testing
  • chen qin
  • covariance
  • multivariate inference
← Back to the glossaryBack to top ↑