The same subjects each receive two measurements, or two models each produce a prediction error on the same subjects: to compare how much the two results fluctuate, every X has a matching Y. The question is whether the two population variances are equal, not whether their means are equal.

The usual independent-sample F test for a variance ratio assumes the two samples are independent. In paired data, X and Y on the same subject often move high or low together; ignoring that pairing computes the sampling distribution of a variance ratio on the wrong data structure. The Morgan–Pitman test brings the within-pair relationship into the calculation and requires only that pairs from different subjects be independent of one another.[1]

Turn a variance comparison into a correlation of sums and differences

For each pair form the sum U = X + Y and the difference V = X − Y. Expanding the covariance, cross terms cancel and yield Cov(U, V) = Var(X) − Var(Y). Therefore, as long as neither population standard deviation of U nor of V is zero, equal population variances are equivalent to a zero population Pearson correlation between U and V.[1]

The transform also keeps direction: with V = X − Y, a negative correlation of sum and difference means Y’s variance exceeds X’s; a positive correlation reverses the direction. The means of X and Y need not be equal, because correlation subtracts the means of U and V separately.

How the classical test is computed

Convert each of the n pairs into Uᵢ and Vᵢ and compute the sample Pearson correlation r of the two columns. The null is equal population variances; under an i.i.d. bivariate-normal paired-observation model, when the null holds the statistic t = r√[(n − 2)/(1 − r²)] follows a t distribution with n − 2 degrees of freedom. The two-sided test uses |t| for the p-value.[1]

A simulated data set

The demonstration below uses 20 independently generated bivariate-normal pairs. Population standard deviations of X and Y are set to 1 and 1.8, their correlation to 0.7, and the random seed to 20261118. The left panel keeps each pair’s (X, Y) position; the right converts the same points to (U, V); the downward trend on the right matches the larger Y variance.

Left: scatter of paired X and Y; right: scatter of transformed sum U and difference V with a downward fitted line

Simulation of independent bivariate-normal pairs, seed 20261118, n = 20; left: X versus Y; right: sum U, difference V, and a linear fit.

In this simulation the sample variances are sX² = 0.9724 and sY² = 3.8918; their difference −2.9195 also equals the sample covariance of U and V. The sample correlation of sum and difference is r = −0.6568, which yields t = −3.6951 on 18 degrees of freedom and two-sided p = 0.00166.

Under the simulation’s model conditions, at a 0.05 significance level this result rejects equal population variances; in the sample Y’s variance is larger. The p-value measures how probable a statistic at least this extreme is under the null; direction and size of the difference should still be reported with the sample variances.

What the result answers

The sum–difference covariance identity is algebraic; computing a finite-sample p-value from the t distribution above depends on the classical model conditions. With heavy tails or outliers the classical test may perform poorly, and a robust method matched to the data structure may be needed. Errors from cross-validation or time series also cannot be treated as independent across pairs merely because they are paired item by item.[1]

Equal variances are also not proof that two instruments agree: systematic differences may remain. For prediction errors, mean squared error equals error variance plus the square of mean error, so equal variances do not prove equal MSEs for two predictors. First clarify whether the comparison concerns fluctuation, measurement agreement, or overall prediction error, then choose the analysis.

References

  1. [1] Arratia, A., Cabaña, A., Mordecki, E., & Rovira-Parra, G. The Morgan-Pitman Test of Equality of Variances and its Application to Machine Learning Model Evaluation and Selection. arXiv:2509.12185v1, 2025-09-15.