Learn R Programming

flintyR (version 0.1.0)

blockPermute: p-value Computation for Test of Exchangeability with Block Dependencies

Description

Generates a block permutation p-value. Uses a heuristic to decide whether to use distance caching or simple block permutations.

Usage

blockPermute(X, block_boundaries = NULL, block_labels = NULL, nruns, type, p)

Value

The block permutation p-value

Arguments

X

The binary or real matrix on which to perform permutation resampling

block_boundaries

Vector denoting the positions where a new block of non-independent features starts. Default is NULL.

block_labels

Length \(P\) vector recording the block label of each feature. Default is NULL.

nruns

The resampling number (use at least 1000)

type

Either an unbiased estimate ('unbiased'), or exact ('valid') p-value (see Hemerik and Goeman, 2018), or both ('both').

p

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

Details

Dependencies: buildForward, buildReverse, cachePermute, cacheBlockPermute1, cacheBlockPermute2, getHammingDistance, getLpDistance, naiveBlockPermute1, naiveBlockPermute2