This function implements the two-sample \(l_\infty\)-norm-based
high-dimensional covariance test proposed in Cai, Liu and Xia (2013).
Suppose \(\{\mathbf{X}_1, \ldots, \mathbf{X}_{n_1}\}\) are i.i.d.
copies of \(\mathbf{X}\), and \(\{\mathbf{Y}_1, \ldots, \mathbf{Y}_{n_2}\}\)
are i.i.d. copies of \(\mathbf{Y}\). The test statistic is defined as
$$T_{CLX} = \max_{1\leq i,j \leq p} \frac{(\hat\sigma_{ij1}-\hat\sigma_{ij2})^2}
{\hat\theta_{ij1}/n_1+\hat\theta_{ij2}/n_2},$$
where \(\hat\sigma_{ij1}\) and \(\hat\sigma_{ij2}\) are the sample covariances,
and \(\hat\theta_{ij1}/n_1+\hat\theta_{ij2}/n_2\) estimates the variance of
\(\hat{\sigma}_{ij1}-\hat{\sigma}_{ij2}\).
The explicit formulas of \(\hat\sigma_{ij1}\), \(\hat\sigma_{ij2}\),
\(\hat\theta_{ij1}\) and \(\hat\theta_{ij2}\) can be found
in Section 2 of Cai, Liu and Xia (2013).
With some regularity conditions, under the null hypothesis \(H_{0c}: \mathbf{\Sigma}_1 = \mathbf{\Sigma}_2\),
the test statistic \(T_{CLX}-4\log p+\log\log p\) converges in distribution to
a Gumbel distribution \(G_{cov}(x) = \exp(-\frac{1}{\sqrt{8\pi}}\exp(-\frac{x}{2}))\)
as \(n_1, n_2, p \rightarrow \infty\).
The asymptotic \(p\)-value is obtained by
$$p_{CLX} = 1-G_{cov}(T_{CLX}-4\log p+\log\log p).$$