Skip to main content
. 2019 Jan 15;8:e41690. doi: 10.7554/eLife.41690
Pseudocode C3 Permutation Test. This algorithm uses the random permutation test with r random permutations for the p-value, requiring 𝒪(rn2logn) for Mgc. In the real-data experiment, we always set r=10,000. Note that the p-value computation for any other global generalized correlation coefficient follows from the same algorithm by replacing Mgc with the respective test statistic.
Input: A pair of distance matrices (A,B)Rn×n×Rn×n, the number of permutations r, and Mgc statistic c* for the observed data.
Output: The p-value pval[0,1].
1: function PermutationTest(A, B, r, c*)
2: for t:=1,,r do
3: π=RANDPERM(n) generate a random permutation of size n
4: c0[t]=MGCSAMPLESTAT(A,B(π,π)) calculate the permuted Mgc statistic
5: end for
6: pval(c)1tt=1rI(cc0[t]) compute p-value of Mgc
7: end function