Tutorials › Multivariate Statistics (Graduate) › U-Statistic Construction for Quadratic Mean Testing

High-Dimensional Mean Testing · Tutorial 806 of 975

U-Statistic Construction for Quadratic Mean Testing

Learn to construct and interpret an unbiased U-statistic for a squared mean norm, and understand why independent cross-products remove the sample-mean bias.

Advanced 10 min read

What You'll Learn

  • Define the pairwise kernel and U-statistic for the squared norm of a population mean
  • Prove unbiasedness under independent, identically distributed sampling
  • Derive the bias in the squared sample mean and its exact correction
  • Decompose the statistic into linear and centered cross-product terms
  • Identify why independence matters and why the statistic can be negative

Why Use Pairwise Cross-Products?

A quadratic mean test targets the squared norm of a population mean vector. If \(X\in\mathbb{R}^p\) has mean \(\mu\), the target is \(\|\mu\|^2=\mu^\top\mu\). The squared norm of the sample mean seems like a natural estimator, but it includes variation from sampling: even when \(\mu=0\), the sample mean is generally not exactly zero, so its squared norm is positive on average. In high dimension, that extra contribution can be substantial.

The construction here replaces products of a vector with itself by products of different independent observations. Those cross-products retain the target while removing the diagonal terms responsible for the bias. This tutorial derives the estimator and its properties; calibrating a test based on it requires additional distributional and variance results.

Definition: Let \(X_1,\ldots,X_n\) be independent, identically distributed random vectors in \(\mathbb{R}^p\), with \(E[X_i]=\mu\) and \(E[\|X_i\|^2]<\infty\). For \(n\geq 2\), define the symmetric kernel \(h(x,y)=x^\top y\) and the order-two U-statistic $$ U_n=\binom{n}{2}^{-1}\sum_{1\leq i<j\leq n}h(X_i,X_j) =\frac{2}{n(n-1)}\sum_{i<j}X_i^\top X_j. $$ Its target is \(\|\mu\|^2\).

The finite second-moment condition makes the kernel integrable: by Cauchy–Schwarz, \(E|X_1^\top X_2|\leq \{E\|X_1\|^2 E\|X_2\|^2\}^{1/2}<\infty\). A U-statistic averages a symmetric function over all subsets of a fixed size; here, every unordered pair contributes once. The dimension \(p\) may be large and may vary with \(n\), but the definition and expectation calculation apply at each dimension.

Unbiasedness and the Sample-Mean Correction

Theorem: Under the assumptions in the definition, \(U_n\) is unbiased for the squared norm of the population mean: $$ E[U_n]=\|\mu\|^2. $$

Proof. For each pair \(i<j\), independence gives $$ E[X_i^\top X_j] =E\!\left[\sum_{k=1}^p X_{ik}X_{jk}\right] =\sum_{k=1}^p E[X_{ik}]E[X_{jk}] =\sum_{k=1}^p\mu_k^2 =\|\mu\|^2. $$ There are \(\binom{n}{2}\) pairs, and \(U_n\) is their average. Therefore $$ E[U_n]=\binom{n}{2}^{-1}\sum_{i<j}E[X_i^\top X_j] =\binom{n}{2}^{-1}\binom{n}{2}\|\mu\|^2 =\|\mu\|^2. $$ \(\square\)

To see what the cross-products correct, write \(\bar X=n^{-1}\sum_i X_i\). Expanding its squared norm separates the diagonal terms from the cross-products: $$ \|\bar X\|^2 =\frac{1}{n^2}\left(\sum_{i=1}^n\|X_i\|^2+2\sum_{i<j}X_i^\top X_j\right). $$ Since the second sum equals \(n(n-1)U_n/2\), this gives the exact identity $$ \|\bar X\|^2=\frac{1}{n^2}\sum_{i=1}^n\|X_i\|^2+\frac{n-1}{n}U_n. $$ The first term consists of self-products \(X_i^\top X_i\); their expectations include the coordinates’ variances as well as their squared means.

For a more familiar expression, let \(\Sigma=\operatorname{Cov}(X_i)\), and define the sample covariance matrix by \(S=(n-1)^{-1}\sum_i(X_i-\bar X)(X_i-\bar X)^\top\). The identity \(\sum_i\|X_i\|^2=(n-1)\operatorname{tr}(S)+n\|\bar X\|^2\), substituted into the expansion above, yields $$ U_n=\|\bar X\|^2-\frac{\operatorname{tr}(S)}{n}. $$ Also, \(E[\|\bar X\|^2]=\|\mu\|^2+\operatorname{tr}(\Sigma)/n\), while \(E[\operatorname{tr}(S)]=\operatorname{tr}(\Sigma)\). Thus the squared sample mean has upward bias \(\operatorname{tr}(\Sigma)/n\); subtracting the sample covariance trace divided by \(n\) corrects that bias.

Worked Example: A Bernoulli Mean

Let \(X_1,X_2,X_3\) be independent Bernoulli random variables with success probability \(q=1/2\). The target is \(\mu^2=q^2=1/4\), and the estimator is $$ U_3=\frac{1}{3}(X_1X_2+X_1X_3+X_2X_3). $$

Independence gives \(E[X_iX_j]=E[X_i]E[X_j]=1/4\) for each pair. Averaging the three expectations gives \(E[U_3]=1/4\), as required. In contrast, \(E[\bar X^2]=q^2+q(1-q)/3=1/4+1/12=1/3\).

For the particular observed values \((1,0,1)\), the three pair-products are \(0,1,0\), so \(U_3=1/3\). The sample mean is \(2/3\); the sample variance is \(S=1/3\); and the correction gives \(\bar X^2-S/3=4/9-1/9=1/3\). One observed value need not equal the target: unbiasedness describes the expectation over repeated samples.

Worked Example: How the Bias Grows With Dimension

Suppose \(X_i\sim N_p(0,I_p)\) independently, where \(I_p\) is the \(p\times p\) identity matrix. The target is \(\|\mu\|^2=0\), and \(\operatorname{tr}(\Sigma)=p\). Therefore $$ E[\|\bar X\|^2]=\frac{p}{n}, \qquad E[U_n]=0. $$

For \(p=1000\) and \(n=20\), the squared sample mean has expectation \(1000/20=50\), despite a zero population mean. The cross-product statistic averages independent-observation products instead, so each pair has expectation \(E[X_i^\top X_j]=0\), and its expectation remains zero. This calculation illustrates why the diagonal contribution cannot be ignored when dimension is large relative to sample size. It does not claim that every observed \(U_n\) will be close to zero.

Decomposition Around the Population Mean

The pairwise construction also gives a useful exact decomposition. It separates a term that changes linearly with the sample mean from a sum of centered cross-products. This is especially informative under the null hypothesis \(\mu=0\), without requiring any approximation or limit argument.

Theorem: Under the assumptions in the definition, set \(Z_i=X_i-\mu\). Then $$ U_n=\|\mu\|^2+2\mu^\top(\bar X-\mu) +\frac{2}{n(n-1)}\sum_{i<j}Z_i^\top Z_j. $$ Moreover, the centered kernel \(g(x,y)=(x-\mu)^\top(y-\mu)\) has conditional mean zero: \(E[g(X_1,X_2)\mid X_1]=0\) almost surely.

Proof. Expand each pair: $$ X_i^\top X_j =\|\mu\|^2+\mu^\top Z_i+\mu^\top Z_j+Z_i^\top Z_j. $$ In the sum over all unordered pairs, each \(Z_i\) appears in exactly \(n-1\) pairs. Thus the constant terms contribute \(\|\mu\|^2\), and the two linear terms together contribute $$ \frac{2(n-1)}{n(n-1)}\sum_{i=1}^n\mu^\top Z_i =2\mu^\top(\bar X-\mu). $$ The remaining terms give the displayed centered cross-product sum. For the conditional-mean claim, independence implies \(E[Z_2\mid X_1]=E[Z_2]=0\), so $$ E[g(X_1,X_2)\mid X_1] =(X_1-\mu)^\top E[Z_2\mid X_1]=0. $$ All these conditional expectations are well-defined under the finite second-moment assumption. \(\square\)

When \(\mu=0\), the linear term disappears and \(U_n\) is exactly an average of centered cross-products. Equivalently, the original kernel satisfies \(E[h(X_1,X_2)\mid X_1]=X_1^\top\mu=0\) under the null. This property is called degeneracy of the kernel under the null. It explains why the null behavior is not obtained simply by treating the statistic as an ordinary sample average of independent terms: different pairs can share observations. The distributional limits and variance estimation needed for inference are separate questions.

Worked Example: A Two-Coordinate Population

Let \(X\in\mathbb{R}^2\) equal \((1,0)^\top\) with probability \(1/2\) and \((0,2)^\top\) with probability \(1/2\). Then $$ \mu=E[X]=(1/2,1)^\top, \qquad \|\mu\|^2=(1/2)^2+1^2=5/4. $$ Take two independent observations, so \(U_2=X_1^\top X_2\).

If both observations equal \((1,0)^\top\), their inner product is \(1\), an event of probability \(1/4\). If both equal \((0,2)^\top\), the inner product is \(4\), also with probability \(1/4\). If they differ, the inner product is \(0\), with probability \(1/2\). Hence $$ E[U_2]=\frac14(1)+\frac14(4)+\frac12(0)=\frac54=\|\mu\|^2. $$ For comparison, \(E[\|X\|^2]=(1+4)/2=5/2\), so \(\operatorname{tr}(\Sigma)=E[\|X\|^2]-\|\mu\|^2=5/4\). The squared sample mean has expectation \(5/4+(5/4)/2=15/8\), which exceeds the target by \(5/8\).

Assumptions, Interpretation, and a Common Pitfall

Independence is essential to the unbiasedness calculation. If \(X_i\) and \(X_j\) are dependent, their cross-product expectation need not factor into the product of their means. For example, for two vectors with common mean \(\mu\), $$ E[X_i^\top X_j]=\|\mu\|^2+\sum_{k=1}^p\operatorname{Cov}(X_{ik},X_{jk}). $$ The extra covariance contribution can make the cross-product average biased. Repeated measurements on the same individuals, or observations clustered within sites, therefore require accounting for their dependence rather than applying the independent-sample formula without adjustment.

Common mistake: It is tempting to say that \(\|\bar X\|^2\) estimates \(\|\mu\|^2\) without bias because \(\bar X\) is unbiased for \(\mu\). That reasoning confuses an unbiased vector estimator with a nonlinear function of that estimator. In fact, $$ E[\|\bar X\|^2]=\|E[\bar X]\|^2+\operatorname{tr}\{\operatorname{Cov}(\bar X)\} =\|\mu\|^2+\frac{\operatorname{tr}(\Sigma)}{n}. $$ The correction, or equivalently the pairwise U-statistic, is needed to remove the extra term.

A related interpretation pitfall is to expect \(U_n\) to be nonnegative because its target is a squared norm. The target is nonnegative, but an unbiased estimator need not be. Under a zero mean, some observed pairwise inner products may be positive and others negative, so their average can be negative. That is not a contradiction; it reflects sampling variation around a zero expectation.

1
Specify the target.
For a mean vector \(\mu\), the quadratic target is \(\|\mu\|^2\).
2
Form independent pairs.
Use \(X_i^\top X_j\) for distinct observations, not the self-product \(X_i^\top X_i\).
3
Average all pairs.
The resulting statistic is unbiased under independent, identically distributed sampling with finite second moments.
4
Keep estimation separate from calibration.
Unbiasedness alone does not give a null distribution, a variance estimate, or a testing threshold.
Key takeaway: The estimator \(U_n=2\{n(n-1)\}^{-1}\sum_{i<j}X_i^\top X_j\) targets \(\|\mu\|^2\) without the \(\operatorname{tr}(\Sigma)/n\) bias of \(\|\bar X\|^2\). Its construction relies on distinct independent observations, and its unbiasedness does not imply that an observed value must be nonnegative.

Check Your Understanding

Use the definitions and derivations above to answer the following.

  1. Why does \(E[X_i^\top X_j]=\|\mu\|^2\) require independence when \(i\ne j\)?
  2. What is the bias of \(\|\bar X\|^2\) when \(X_i\) has covariance matrix \(\Sigma\)?
  3. Why can \(U_n\) be negative even though its target is a squared norm?
  4. Under the null \(\mu=0\), what happens to the linear term in the decomposition of \(U_n\)?
  5. For dependent observations with a common mean, what additional term can appear in \(E[X_i^\top X_j]\)?
Clinical Biostats