Computes \(V\) statistic for a real matrix \(\mathbf{X}\), where \(V(\mathbf{X})\) = scaled variance of \(l_p^p\) distances between the row samples of \(\mathbf{X}\).

getRealVStat(X, p)

Arguments

X

The \(N \times P\) real matrix

p

The power \(p\) of \(l_p^p\), i.e., \(||x||_p^p = (x_1^p+...x_n^p)\)s

Value

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

Details

Dependencies: getLpDistance

Examples

X <- matrix(nrow = 5, ncol = 10, rnorm(50))
getRealVStat(X, p = 2)
#> [1] 6.768452