naiveBlockPermute1 | R Documentation |
Generates a new array \mathbf{X}'
under the permutation null and then
returns the V
statistic computed for \mathbf{X}'
.
naiveBlockPermute1(X, block_labels, p)
X |
The |
block_labels |
A vector of length |
p |
The power |
This is Version 1, which takes in the block labels. It is suitable in
the most general setting, where the features are grouped by labels.
Given original \mathbf{X}
and a list denoting labels of each feature,
independently permutes the rows within each block of \mathbf{X}
and returns resulting V
.
If block labels are not specified, then features are assumed independent, which
is to say that block_labels is set to 1:ncol(\mathbf{X}
).
Dependencies: getBinVStat, getRealVStat
V(\mathbf{X}')
, where \mathbf{X}'
is a resampled by permutation of entries blockwise
X <- matrix(nrow = 5, ncol = 10, rnorm(50)) # real matrix example
naiveBlockPermute1(X, block_labels = c(1,1,2,2,3,3,4,4,5,5), p = 2) # use Euclidean distance
X <- matrix(nrow = 5, ncol = 10, rbinom(50, 1, 0.5)) # binary matrix example
naiveBlockPermute1(X, block_labels = c(1,1,2,2,3,3,4,4,5,5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.