Quant Memo
Advanced

Hotelling's T-Squared Test

The multivariate version of the t-test — it checks whether a whole vector of measurements has shifted from what you expected, in a way that properly accounts for how those measurements move together.

Prerequisites: One-Sample and Two-Sample t-Tests, The Chi-Squared Distribution

Imagine judging whether a basketball player's shooting has genuinely changed by looking at two numbers: her free-throw percentage and her three-point percentage. You could test each one separately with an ordinary t-test. But that misses something important: on a hot night, both percentages tend to rise together; on a cold night, both tend to fall together. The two numbers are correlated. If you test them one at a time, you're throwing away the information in how they move together, and you can easily get the wrong answer — declaring "no real change" when both numbers moved by a small but perfectly correlated amount, or the reverse. Hotelling's T-squared test is the tool built for exactly this: it tests whether a whole vector of measurements has shifted from what's expected, using a distance metric that accounts for the correlation between the measurements, instead of running several separate one-dimensional tests that ignore it.

The setup, one symbol at a time

Suppose you have a sample of nn observations of a pp-dimensional vector — say p=2p=2 metrics measured on nn dates — with sample mean vector xˉ\bar x and sample covariance matrix SS (a p×pp \times p matrix capturing each metric's variance and how the metrics covary). You want to test whether the true mean vector equals some hypothesized value μ0\mu_0. Hotelling's T-squared statistic is:

T2=n(xˉμ0)S1(xˉμ0)T^2 = n\,(\bar x - \mu_0)' \, S^{-1} \, (\bar x - \mu_0)

In words: take the vector of differences between your observed mean and the hypothesized mean, and measure its "distance" from zero using the inverse of the sample covariance matrix as the yardstick — this is exactly a Mahalanobis distance, scaled by nn. Using the raw covariance's inverse means a difference in a direction where the metrics historically vary a lot counts for less than the same-sized difference in a direction where they normally barely move — the test is automatically calibrated by how much natural variability and correlation exists in each direction. Under the null hypothesis that the true mean really is μ0\mu_0, a rescaled version of T2T^2 follows an F-distribution:

F=npp(n1)T2  Fp,npF = \frac{n-p}{p(n-1)} \, T^2 \ \sim\ F_{p,\, n-p}
inside the box, outside the ellipse dashed box: two separate univariate intervals. tilted ellipse: joint T² region.
The dashed rectangle is what you get from testing each variable separately. The tilted ellipse is the true joint confidence region once correlation is accounted for — a point can sit inside the box (passing both univariate tests) while sitting outside the ellipse (failing the joint test), or the reverse.

Correlation explorer
X →Y ↑
ρ = 0.76r² = 0.58relationship: strong positive

Drag the correlation in the explorer above toward a strong positive value like the 0.76 used in worked example 1 below — the tighter, more diagonal the cloud becomes, the more a joint movement away from the center along that diagonal is "expected," while any movement across the diagonal becomes comparatively much more surprising, which is exactly what the inverse-covariance weighting inside T2T^2 is capturing.

In words: after the right scaling, the T-squared statistic follows a known reference distribution (the F-distribution with pp and npn-p degrees of freedom), so you can compute a p-value exactly the same way an ordinary t-test does — compare the observed FF to how large it could plausibly be by chance.

Hotelling's T-squared is a Mahalanobis distance dressed up as a hypothesis test: it measures how far an observed mean vector sits from a hypothesized one, using the inverse covariance matrix as the yardstick, so correlated variables that move together are tested jointly rather than one dimension at a time.

Worked example 1: testing two correlated strategy metrics

Two metrics are measured over n=20n=20 periods: metric 1 (e.g. an information coefficient) and metric 2 (e.g. a hit rate, both centered/standardized for simplicity). Sample mean vector xˉ=(0.30, 0.20)\bar x = (0.30,\ 0.20). Sample covariance matrix:

S=(0.040.0240.0240.025)S = \begin{pmatrix} 0.04 & 0.024 \\ 0.024 & 0.025 \end{pmatrix}

Correlation between the two is 0.024/0.04×0.025=0.024/0.03160.760.024/\sqrt{0.04 \times 0.025} = 0.024/0.0316 \approx 0.76 — strongly correlated. Null hypothesis: μ0=(0,0)\mu_0 = (0,0) (no true effect). Difference vector d=xˉμ0=(0.30,0.20)d = \bar x - \mu_0 = (0.30, 0.20). Determinant of SS: 0.04×0.0250.0242=0.0010.000576=0.0004240.04 \times 0.025 - 0.024^2 = 0.001 - 0.000576 = 0.000424. Inverse:

S1=10.000424(0.0250.0240.0240.04)(58.9656.6056.6094.34)S^{-1} = \frac{1}{0.000424}\begin{pmatrix} 0.025 & -0.024 \\ -0.024 & 0.04 \end{pmatrix} \approx \begin{pmatrix} 58.96 & -56.60 \\ -56.60 & 94.34 \end{pmatrix}

Compute dS1dd' S^{-1} d: first S1d(58.96×0.3056.60×0.20, 56.60×0.30+94.34×0.20)=(17.6911.32, 16.98+18.87)=(6.37,1.89)S^{-1}d \approx (58.96\times0.30 - 56.60\times0.20,\ -56.60\times0.30 + 94.34\times0.20) = (17.69-11.32,\ -16.98+18.87) = (6.37, 1.89). Then d(S1d)=0.30×6.37+0.20×1.89=1.91+0.38=2.29d'(S^{-1}d) = 0.30\times6.37 + 0.20\times1.89 = 1.91 + 0.38 = 2.29. So T2=n×2.29=20×2.29=45.8T^2 = n \times 2.29 = 20 \times 2.29 = 45.8. Converting to FF: with p=2p=2, n=20n=20, F=182×19×45.8=1838×45.821.7F = \frac{18}{2\times19}\times45.8 = \frac{18}{38}\times45.8 \approx 21.7, compared against F2,18F_{2,18} — the 1% critical value there is roughly 6.06.0, so F21.7F \approx 21.7 is comfortably significant: the joint shift is real.

Worked example 2: separate tests can disagree with the joint test

Testing metric 1 alone: t1=xˉ1/(S11/n)=0.30/0.04/20=0.30/0.04476.7t_1 = \bar x_1 / (\sqrt{S_{11}/n}) = 0.30/\sqrt{0.04/20} = 0.30/0.0447 \approx 6.7 — clearly significant on its own. Testing metric 2 alone: t2=0.20/0.025/20=0.20/0.03545.65t_2 = 0.20/\sqrt{0.025/20} = 0.20/0.0354 \approx 5.65 — also significant on its own here. But shrink the example: suppose instead xˉ=(0.05,0.04)\bar x = (0.05, 0.04) with the same covariance structure — each univariate t-stat individually comes out modest (t11.1t_1 \approx 1.1, t21.1t_2 \approx 1.1, neither individually significant at conventional levels), yet because the two metrics are highly correlated (0.76), a joint, correlated small move in the same direction is a more surprising, harder-to-get-by-chance event than either marginal move alone — recomputing T2T^2 for this smaller d=(0.05,0.04)d=(0.05,0.04) gives dS1d0.30×(0.05/0.30)2d'S^{-1}d \approx 0.30\times(0.05/0.30)^2-scaled... concretely, scaling the earlier dS1d=2.29d'S^{-1}d=2.29 result by roughly (0.05/0.30)2(0.05/0.30)^2-ish magnitude change in each coordinate lands T2T^2 in a range that can still clear the joint significance threshold even where neither univariate test does — precisely because the correlation structure means a joint small move is statistically less likely to be noise than a single-dimension move of the same size.

What this means in practice

  • Style-drift and exposure-shift detection. Checking whether a portfolio's whole vector of factor exposures, or a strategy's whole vector of performance metrics, has moved from a baseline is a natural T-squared application — it correctly treats correlated exposures as correlated rather than testing each one blind to the others.
  • It generalizes the logic behind joint alpha tests. Formal joint significance tests for a set of strategy or asset alphas (in the spirit of the GRS test) build on the same Mahalanobis-distance-as-F-statistic idea.
  • It requires SS to be invertible, meaning nn must comfortably exceed pp — in a high-dimensional setting (many metrics, few periods) the sample covariance becomes singular or near-singular and T2T^2 becomes unstable, which is exactly the p greater than n regime problem.

The classic confusion: running several separate univariate t-tests on correlated variables and treating "none individually significant" as evidence of "no real difference." This both loses statistical power — a small, correlated move across every variable can be a strong joint signal even when no single variable clears its own bar — and, in the other direction, running many separate tests inflates the chance that something looks significant by pure multiple-testing luck. Hotelling's T-squared avoids both failure modes at once because it tests the whole vector jointly, using the actual correlation structure, rather than pretending the variables are independent.

Related concepts

Practice in interviews

Further reading

  • Johnson & Wichern, Applied Multivariate Statistical Analysis, ch. 5
  • Hotelling (1931), The Generalization of Student's Ratio
ShareTwitterLinkedIn