A good scientific research audit is not a summary. It has to read the paper, identify the important aspects, verify the formulas and derivations, and then run a small experiment to see whether the theory aligns with practice. That is the kind of task we gave Bystro.
The target was Ahmad (2022), "Tests for proportionality of matrices with large dimension," a Journal of Multivariate Analysis paper proposing a test for whether two covariance matrices are proportional in high dimensions. The null is , where . This is a useful setup because classical covariance tests often depend on empirical covariance inverses or determinants, which break down when is large relative to . Our interest in hypothesis tests for covariance matrices originates from our work in detecting parent of origin effects from GWAS, which depends on these types of tests. To our surprise, while there is extensive literature on this subject, code implementations are sparse (we will soon to release scikit-covtest, our Python package addressing this)!
We asked Bystro to audit the method. It found two serious mathematical issues: one in the finite-sample estimator used in the denominator of the statistic, and one in the stated null distribution of the final test statistic.
Figure 1. The prompt and clarifying questions.
The proposed statistic is based on the trace identity behind the proportionality problem. If two positive-definite covariance matrices are proportional, then the normalized trace overlap
equals 1 (if you substitute the null hypothesis for , you can see this quantity is exactly 1). The paper estimates the numerator with and the two denominator terms with one-sample estimators for .
That denominator estimator is where Bystro started. The paper states in Definition 1 / Eq. (10):
where and .
Appendix B gives an equivalent U-statistic representation for the same estimator. Bystro expanded that degree-4 kernel and reduced it using the centering identity . That independent derivation gives:
Equivalently:
So, the printed formula subtracts too much by a factor of in the bracket. This is not a cosmetic typo. is supposed to estimate , a positive trace quantity. Under simple null simulations, the printed expression can go negative, which makes the denominator of the test statistic nonsensical before asymptotics even enter the story.
Figure 2. Bystro realizes there’s an error in the test statistic from Ahmad (2022).
The second issue is an internal contradiction, and of the two is the more serious error. Eq. (16) in the paper states:
Under the null hypothesis , hence substitution gives variance 4. But the surrounding text says Eqs. (15)-(16) reduce to 0 and 1, and Theorem 2 states:
While a thorough derivation of the work makes it clear that 4 is correct, many people who read the paper (including yours truly) lack the time for derivations. In a pinch, I just search for the theorem section, implement the formula for the test statistic, and then compute the p-value from the null distribution. In this case, the calibrated test should reject using
rather than . The same factor-of-2 issue appears in the multi-sample extension, where the covariance matrix reduces to under the null but the theorem states an identity covariance limit.
Bystro then checked whether the contradiction matters in practice (naturally it should, and strongly at that). We reproduced the null setting , , , using the corrected formula so that the comparison isolates the null-calibration error. Across 1,500 Monte Carlo replicates with a fixed seed, the empirical variance of was 4.15, close to the value implied by Eq. (16), not the value stated in Theorem 2.
Figure 3. Spot simulation under . The empirical null distribution of tracks rather than . The paper cutoff rejects about 34.7% of null simulations; the corrected cutoff rejects about 5.1%. In the same run, the printed Eq. (10) version of was nonpositive in 100.0% of replicates.
The important part is not just that Bystro found a contradiction. It used several independent checks that thoroughly diagnose the error:
A purely computational evaluation of a method is insufficient in these applications. This type of statistics requires distributional convergence which only holds exactly with infinite sample size. For any specific generation mechanism, a natural (but incorrect) excuse would be that the sample size is simply too small for asymptotics to be applicable. A purely theoretical review might focus on irrelevant aspects (i.e. maximum likelihood or unbiased variance estimate). The combination of both is truly required to evaluate the method.
We want to be clear, this is solid work. The derivations are thorough, and once the errors are fixed the test performs well. The author has a strong body of literature. We simply wish to highlight that two small typos can undo all that hard work unless the reader works through the derivations with enough care and expertise to spot the error. This is the kind of failure mode that matters for research software. One coefficient or one missing normalization can turn a nominal 5% test into a highly anti-conservative test. Bystro was able to catch that error with no effort on my part (except verifying the output).
The standalone reproduction script is below as ahmad_spot_simulation.py. The calibration check is:
The script uses Gram matrices to avoid forming p by p covariance matrices, so it runs quickly even at p = 1000.