An exact finite-sample test for whether two groups share a covariance matrix, the
omnibus form of the differential-network question. Under the Gaussian null the
likelihood-ratio statistic has a distribution given by the real Jacobi ensemble that is
free of the unknown common covariance, so a single Monte-Carlo calibration at the identity
serves every covariance with no estimate of the nuisance covariance; this is the property
that survives the dimension barrier, where estimating the covariance is hardest. The
max-type high-dimensional test of Cai, Liu and Xia (2013)
An exact, covariance-free test for a change in covariance structure. The likelihood-ratio null does not depend on the unknown common covariance, so one calibration serves every covariance.
Computation runs on a shared pure-C back-end that is also bound from Python, and the two front ends are checked against each other value by value.
# install.packages("remotes")
remotes::install_github("mtloots/regstat", subdir = "regstat")
library(regstat)
set.seed(1)
XA <- matrix(rnorm(180), 60, 3)
XB <- matrix(rnorm(150), 50, 3) %*% diag(c(1, 1.6, 0.7))
c(same = cov_M(XA, XA), different = cov_M(XA, XB))
#> same different
#> 0.00000 35.19953
cov_test(XA, XB, method = "exact")$p.value
#> [1] 6.38278e-06