R/auxiliary.R
getBlockCov.Rd
Computes covariance matrix entries and associated alpha, beta and gamma quantities defined in Aw, Spence and Song (2021), for partitionable features that are grouped into blocks. Uses precomputation to compute the unique entries of the asymptotic covariance matrix of the pairwise Hamming distances in \(O(N^2)\) time.
getBlockCov(X, block_boundaries, block_labels, p = 2)
The binary or real matrix
Vector denoting the positions where a new block of non-independent features starts.
Length \(P\) vector recording the block label of each feature.
The power \(p\) of \(l_p^p\), i.e., \(||x||_p^p = (x_1^p+...x_n^p)\)
The three distinct entries of covariance matrix, \((\alpha, \beta, \gamma)\)
This is used in the large \(P\) asymptotics of the permutation test.
Dependencies: buildReverse, getHammingDistance, getLpDistance