naiveBlockPermute2: Resampling V Statistic (Version 2)

View source: R/auxiliary.R

naiveBlockPermute2R Documentation

Resampling V Statistic (Version 2)

Description

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

Usage

naiveBlockPermute2(X, block_boundaries, p)

Arguments

X

The N \times P binary or real matrix

block_boundaries

A vector of length at most P, whose entries indicate positions at which to demarcate blocks

p

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

Details

This is Version 2, which takes in the block boundaries. It is suitable for use when the features are already arranged such that the block memberships are determined by index delimiters. 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

Value

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

Examples

X <- matrix(nrow = 5, ncol = 10, rnorm(50)) # real matrix example
naiveBlockPermute2(X, block_boundaries = c(4,7,9), p = 2) # use Euclidean distance

X <- matrix(nrow = 5, ncol = 10, rbinom(50, 1, 0.5)) # binary matrix example
naiveBlockPermute2(X, block_boundaries = c(4,7,9))


flintyR documentation built on March 31, 2023, 8:19 p.m.