Skip to content

Hotelling T-squared test

Test a multivariate mean with covariance-scaled distance, an exact F reference law and a confidence ellipsoid; see why normal sampling and invertibility matter.

The Hotelling T-squared test tests a population mean vector against a specified vector, using the sample covariance to measure the discrepancy jointly. For a quant checking two model errors, it asks whether the pair of average errors is inconsistent with the target pair after allowing for their scales and co-movement. This article develops the one-sample test; comparing two independent samples needs a different covariance estimate and calibration.

One null hypothesis for the whole vector

Let X1,…,Xn\mathbf{X}_1,\ldots,\mathbf{X}_n be independent, identically distributed pp-dimensional observations. Coordinates within an observation may be correlated. Write the sample mean as Xˉ\bar{\mathbf{X}} and use the unbiased covariance matrix:
S=1n−1∑i=1n(Xi−Xˉ)(Xi−Xˉ)⊤.S=\frac{1}{n-1}\sum_{i=1}^{n}(\mathbf{X}_i-\bar{\mathbf{X}})(\mathbf{X}_i-\bar{\mathbf{X}})^\top.

For H0:μ=μ0H_0:\boldsymbol{\mu}=\boldsymbol{\mu}_0 against any different mean vector, the statistic is

T2=n(Xˉ−μ0)⊤S−1(Xˉ−μ0).T^2=n(\bar{\mathbf{X}}-\boldsymbol{\mu}_0)^\top S^{-1}(\bar{\mathbf{X}}-\boldsymbol{\mu}_0).
The inverse covariance discounts deviations along noisy directions and gives more weight to deviations along precisely measured directions. Correlation matters: two coordinates moving together need not provide two independent pieces of evidence. For p=1p=1, this becomes the ordinary one-sample tt statistic squared, n(Xˉ−μ0)2/s2n(\bar X-\mu_0)^2/s^2. NIST gives this univariate-to-multivariate construction.
Geometrically, T2=nDS2(Xˉ,μ0)T^2=nD_S^2(\bar{\mathbf{X}},\boldsymbol{\mu}_0), where DSD_S is the Mahalanobis distance computed with SS. Equivalently, T2T^2 is the squared distance using S/nS/n, the estimated covariance of the sample mean. The factor nn belongs here because the object being tested is an average, rather than an individual observation. Stanford's one-sample notes explain this covariance scaling.

The exact reference distribution has conditions

For the finite-sample result below, assume the observation vectors are i.i.d. from a multivariate normal distribution with a fixed mean and a positive-definite population covariance Σ\Sigma. Require n>pn>p and an invertible SS. Under this continuous normal model, n>pn>p makes SS invertible with probability one; exact collinearity in actual data still prevents the calculation.

Under H0H_0,

F=n−pp(n−1)T2∼Fp,n−p.F=\frac{n-p}{p(n-1)}T^2\sim F_{p,n-p}.

Reject for a large value of FF, using its upper tail. Here Fa,b;1−αF_{a,b;1-\alpha} denotes the (1−α)(1-\alpha) quantile, so the critical value for T2T^2 is

cα=p(n−1)n−pFp,n−p;1−α.c_\alpha=\frac{p(n-1)}{n-p}F_{p,n-p;1-\alpha}.
Estimating the covariance creates extra uncertainty. Replacing this finite-sample calibration with a chi-square cutoff can matter substantially when nn is small. The normal theory uses the independence of the sample mean and sample covariance, with (n−1)S(n-1)S having a Wishart distribution. Stanford derives that distributional construction; NIST states the one-sample FF transformation.

A fictional desk checks two pricing errors

Suppose a model-validation desk has ten independent paired pricing-error observations, measured in basis points, from the stated bivariate normal model. These are invented sample summaries, not market data. The target mean is zero for both instruments:

n=10,p=2,xˉ=(12),μ0=(00),S=(4009).n=10,\qquad p=2,\qquad \bar{\mathbf{x}}=\begin{pmatrix}1\\2\end{pmatrix},\qquad \boldsymbol{\mu}_0=\begin{pmatrix}0\\0\end{pmatrix},\qquad S=\begin{pmatrix}4&0\\0&9\end{pmatrix}.

The covariance entries have units of squared basis points. Since this particular SS is diagonal,

T2=10(124+229)=12518≈6.9444,F=82×912518=25081≈3.0864.T^2=10\left(\frac{1^2}{4}+\frac{2^2}{9}\right) =\frac{125}{18}\approx6.9444, \qquad F=\frac{8}{2\times9}\frac{125}{18} =\frac{250}{81}\approx3.0864.
The upper-tail p-value from F2,8F_{2,8} is approximately 0.10150.1015. At a preselected 5%5\% level, the FF cutoff is 4.45904.4590, or T2=10.0327T^2=10.0327: the desk does not reject the zero mean vector. This does not establish that both biases are zero, nor that the model is accurate enough for its intended use. Ten observations leave substantial uncertainty.

Turn the test into a confidence ellipsoid

Invert the same test over candidate mean vectors μ\boldsymbol{\mu}. Under the same assumptions, the exact 100(1−α)%100(1-\alpha)\% confidence region is

{μ:  n(xˉ−μ)⊤S−1(xˉ−μ)≤cα}.\left\{\boldsymbol{\mu}:\; n(\bar{\mathbf{x}}-\boldsymbol{\mu})^\top S^{-1} (\bar{\mathbf{x}}-\boldsymbol{\mu})\le c_\alpha\right\}.
It is an ellipse for two coordinates and an ellipsoid in higher dimensions. Its centre is the sample mean; the covariance determines its orientation and relative axis lengths. This follows by solving the preceding test inequality for μ\boldsymbol{\mu}. The confidence level describes repeated-sample coverage of the whole true vector, just as a confidence interval describes coverage in one dimension.
The fictional 95% confidence ellipse is centred at mean errors (1, 2) basis points. Its semiaxes are about 2.0033 and 3.0049 basis points. The zero vector is inside because its T-squared is 6.9444, below the boundary value 10.0327.
The fictional 95% confidence ellipse is centred at mean errors (1, 2) basis points. Its semiaxes are about 2.0033 and 3.0049 basis points. The zero vector is inside because its T-squared is 6.9444, below the boundary value 10.0327.

The joint 95% region contains zero, matching the test's failure to reject at 5%. This is uncertainty about the population mean vector, not a prediction region for a future pricing-error observation.

The ellipse also makes a useful distinction from separate tt tests. A collection of unadjusted coordinate-wise intervals does not automatically have the same joint coverage, and a joint rejection does not by itself identify which coordinates differ. Stanford discusses Hotelling's test through its search across linear combinations.

Where the classical test stops

Serially dependent returns or overlapping backtest observations do not satisfy the independent-row model. Their sample-mean covariance need not equal Σ/n\Sigma/n. Volatility changes and heavy tails also undermine the exact normal calibration. A dependence-aware covariance estimator or resampling design needs its own justified reference distribution; inserting it into T2T^2 does not preserve the displayed exact FF law.

Dimension is another constraint. The centred sample covariance has rank at most n−1n-1, so it is necessarily singular when p≥np\ge n. Even with p<np<n, nearly redundant variables can make the inverse unstable. A pseudoinverse or shrinkage estimator changes the procedure and requires separate calibration. Adding more instruments is not a free increase in evidence.

For the underlying test/interval duality and careful interpretation of a non-rejection, see Confidence Intervals and Hypothesis Testing (public preview; full lesson requires membership).

Sources

Last updated
  • multivariate inference
  • mean vector
  • hotelling t squared
  • confidence ellipsoid
  • covariance
← Back to the glossaryBack to top ↑