Generates a block permutation p-value.

distDataPermute(dist_list, nruns, type)

Arguments

dist_list

The list (length \(B\)) of pairwise distance data. Each element in list should be either a distance matrix or a table recording pairwise distances.

nruns

The resampling number (use at least 1000)

type

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

Value

The p-value obtained from comparing the empirical tail cdf of the observed \(V\) statistic computed from distance data.

Details

Generates a block permutation distribution of \(V\) statistic by storing the provided list of distance data as an \({N\choose2} \times B\) array, and then permuting the underlying indices of each individual to generate resampled \({N\choose2} \times B\) arrays. The observed \(V\) statistic is also computed from the distance data.

Each element of dist_list should be a \(N\times N\) distance matrix.

Dependencies: buildForward, buildReverse, cachePermute