Computes \(V\) statistic for a binary matrix \(\mathbf{X}\), as defined in Aw, Spence and Song (2021+).

getBinVStat(X)

Arguments

X

The \(N \times P\) binary matrix

Value

\(V(\mathbf{X})\), the variance of the pairwise Hamming distance between samples

Details

Dependencies: getHammingDistance

Examples

X <- matrix(nrow = 5, ncol = 10, rbinom(50, 1, 0.5))
getBinVStat(X)
#> [1] 0.4488889