naiveBlockPermute1 {flintyR}R Documentation

Resampling V Statistic (Version 1)

Description

Generates a new array X\mathbf{X}' under the permutation null and then returns the VV statistic computed for X\mathbf{X}'.

Usage

naiveBlockPermute1(X, block_labels, p)

Arguments

X

The N×PN \times P binary or real matrix

block_labels

A vector of length PP, whose ppth component indicates the block membership of feature pp

p

The power pp of lppl_p^p, i.e., xpp=(x1p+...xnp)||x||_p^p = (x_1^p+...x_n^p)

Details

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 X\mathbf{X} and a list denoting labels of each feature, independently permutes the rows within each block of X\mathbf{X} and returns resulting VV. If block labels are not specified, then features are assumed independent, which is to say that block_labels is set to 1:ncol(X\mathbf{X}).

Dependencies: getBinVStat, getRealVStat

Value

V(X)V(\mathbf{X}'), where X\mathbf{X}' is a resampled by permutation of entries blockwise

Examples

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))


[Package flintyR version 0.1.0 Index]