Pseudocode C6 Power computation of Mgc against a given distribution. By repeatedly sampling from the joint distribution , sample data of size under the null and the alternative are generated for Monte-Carlo replicates. The power of Mgc follows by computing the test statistic under the null and the alternative using Algorithm C2. In the simulations we use , MC replicates. Note that power computation for other benchmarks follows from the same algorithm by plugging in the respective test statistic. |
Input: A joint distribution , the sample size , the number of MC replicates , and the type error level . |
Output: The power of Mgc. |
1: |
function MGCPower(, , , ) |
|
2: |
for
do
|
|
3: |
for
do
|
|
4: |
|
sample from null |
5: |
|
sample from alternative |
6: |
end for
|
|
7: |
for
do
|
|
8: |
,
|
pairwise distances under the null |
9: |
,
|
pairwise distances under the alternative |
10: |
end for
|
|
11: |
|
Mgc statistic under the null |
12: |
|
Mgc statistic under the alternative |
13: |
end for
|
|
14: |
|
the critical value of Mgc under the null |
15: |
|
compute power by the alternative distribution |
16: |
end function |
|