Permutation statistics

Options for permutation statistics: max-statistic, cluster-mass and TFCE.

This example illustrates different options for null-distirbutions in permutation tests. All are illustrated using a simple t-test. For simulating more complex datasets see other examples in this section.

For the sake of speed, the tests here are based on 1000 permutations of the data (samples=1000). For precise p-values, 10000 permutations (the default) are preferable.

# sphinx_gallery_thumbnail_number = 2
from eelbrain import *
import scipy.stats


data = datasets.simulate_erp()
eeg = data['eeg']
p = plot.TopoButterfly(eeg, t=0.13, head_radius=0.35)
permutation statistics

Max statistic

The max statistic is simply the maximum across the entire t-map. The permutation distribution consist of max(t) for each permutation. This is the default, and is also the fastest test.

result = testnd.TTestOneSample(eeg, samples=1000)
Permutation test:   0%|          | 0/1000 [00:00<?, ? permutations/s]
Permutation test:   4%|▍         | 42/1000 [00:00<00:02, 416.54 permutations/s]
Permutation test:   9%|▉         | 89/1000 [00:00<00:02, 442.85 permutations/s]
Permutation test:  14%|█▎        | 135/1000 [00:00<00:01, 447.91 permutations/s]
Permutation test:  18%|█▊        | 182/1000 [00:00<00:01, 452.94 permutations/s]
Permutation test:  23%|██▎       | 228/1000 [00:00<00:01, 453.61 permutations/s]
Permutation test:  27%|██▋       | 274/1000 [00:00<00:01, 454.46 permutations/s]
Permutation test:  32%|███▏      | 320/1000 [00:00<00:01, 451.23 permutations/s]
Permutation test:  37%|███▋      | 366/1000 [00:00<00:01, 450.40 permutations/s]
Permutation test:  41%|████      | 412/1000 [00:00<00:01, 451.16 permutations/s]
Permutation test:  46%|████▌     | 458/1000 [00:01<00:01, 447.36 permutations/s]
Permutation test:  50%|█████     | 504/1000 [00:01<00:01, 447.24 permutations/s]
Permutation test:  55%|█████▍    | 549/1000 [00:01<00:01, 446.68 permutations/s]
Permutation test:  60%|█████▉    | 595/1000 [00:01<00:00, 446.14 permutations/s]
Permutation test:  64%|██████▍   | 640/1000 [00:01<00:00, 444.75 permutations/s]
Permutation test:  68%|██████▊   | 685/1000 [00:01<00:00, 446.14 permutations/s]
Permutation test:  73%|███████▎  | 731/1000 [00:01<00:00, 446.96 permutations/s]
Permutation test:  78%|███████▊  | 776/1000 [00:01<00:00, 447.41 permutations/s]
Permutation test:  82%|████████▏ | 821/1000 [00:01<00:00, 448.11 permutations/s]
Permutation test:  87%|████████▋ | 867/1000 [00:01<00:00, 450.37 permutations/s]
Permutation test:  91%|█████████▏| 913/1000 [00:02<00:00, 450.08 permutations/s]
Permutation test:  96%|█████████▌| 959/1000 [00:02<00:00, 449.24 permutations/s]
Permutation test: 100%|██████████| 1000/1000 [00:02<00:00, 449.10 permutations/s]

Visualize the permutation distribution. We consider values significant if they are larger than 95% of the permutation distribution, so we look for the 95th percentile:

significance_threshold = scipy.stats.scoreatpercentile(result.permutation_distribution, 95)
p = plot.Histogram(
    result.permutation_distribution, title='Distribution of $max(t)$',
    xlabel='max(t)', ylabel='Number of permutations')
p.add_vline(significance_threshold, color='red', linestyle='--')
_ = p.axes[0].text(significance_threshold, 40, ' 95%', color='red')
Distribution of $max(t)$

In the actual comparison, any data point with a t-value that is more extreme than 95% of the permutation distribution is considered signifiacant:

p = plot.TopoButterfly(result, t=0.13, head_radius=0.35)
permutation statistics

Significant regions can be retrieved as Dataset of NDVar for further analysis (e.g., for defining ROIs). This function will find all contiguous regions in which p ≤ .05:

significan_regions = result.find_clusters(0.05, maps=True)
significan_regions
id tstart tstop duration n_sensors p sig
1 0.095 0.17 0.075 27 0 ***
10 0.25 0.26 0.01 1 0.004 **
17 0.09 0.095 0.005 1 0.023 *
25 0.165 0.17 0.005 1 0.021 *
37 0.09 0.165 0.075 11 0 ***
NDVars: cluster


p = plot.TopoButterfly(significan_regions[0, 'cluster'], t=0.13, head_radius=0.35)
permutation statistics

Cluster-based tests

In cluster-based tests, a first steps consists in finding contiguous regions of “meaningful” effect, so-called clusters. “Meaningful” can be defined based on a value of the statistic (e.g., a t-value). It is commonly set to a t value equivalent to uncorrected p = .05. This is specified with the pmin=.05 argument.

A summary statistic is then computed for each cluster. In Eelbrain this is the cluster-mass statistic: the sum of all values in the cluster (i.e., the sum of the t values at all datapoints that are part of the cluster). The clustering procedure is repeated in each permutation, and the largest cluster-mass value is retained, to derive a permutation distribution for cluster-mass values expected under the null hypothesis. Each cluster in the actual data can then be evaluated against this distribution.

result = testnd.TTestOneSample(eeg, samples=1000, pmin=.05)
p = plot.TopoButterfly(result, t=0.13, head_radius=0.35)
permutation statistics
Permutation test:   0%|          | 0/1000 [00:00<?, ? permutations/s]
Permutation test:   3%|▎         | 34/1000 [00:00<00:02, 328.20 permutations/s]
Permutation test:   7%|▋         | 73/1000 [00:00<00:02, 355.03 permutations/s]
Permutation test:  11%|█         | 110/1000 [00:00<00:02, 360.51 permutations/s]
Permutation test:  15%|█▍        | 149/1000 [00:00<00:02, 367.76 permutations/s]
Permutation test:  19%|█▊        | 187/1000 [00:00<00:02, 370.24 permutations/s]
Permutation test:  22%|██▎       | 225/1000 [00:00<00:02, 369.95 permutations/s]
Permutation test:  26%|██▋       | 263/1000 [00:00<00:01, 371.64 permutations/s]
Permutation test:  30%|███       | 301/1000 [00:00<00:01, 371.97 permutations/s]
Permutation test:  34%|███▍      | 339/1000 [00:00<00:01, 372.49 permutations/s]
Permutation test:  38%|███▊      | 378/1000 [00:01<00:01, 374.32 permutations/s]
Permutation test:  42%|████▏     | 416/1000 [00:01<00:01, 374.77 permutations/s]
Permutation test:  45%|████▌     | 454/1000 [00:01<00:01, 375.26 permutations/s]
Permutation test:  49%|████▉     | 492/1000 [00:01<00:01, 374.62 permutations/s]
Permutation test:  53%|█████▎    | 530/1000 [00:01<00:01, 374.12 permutations/s]
Permutation test:  57%|█████▋    | 568/1000 [00:01<00:01, 375.58 permutations/s]
Permutation test:  61%|██████    | 607/1000 [00:01<00:01, 376.81 permutations/s]
Permutation test:  64%|██████▍   | 645/1000 [00:01<00:00, 377.40 permutations/s]
Permutation test:  68%|██████▊   | 683/1000 [00:01<00:00, 374.63 permutations/s]
Permutation test:  72%|███████▏  | 721/1000 [00:01<00:00, 374.53 permutations/s]
Permutation test:  76%|███████▌  | 760/1000 [00:02<00:00, 375.49 permutations/s]
Permutation test:  80%|████████  | 800/1000 [00:02<00:00, 380.78 permutations/s]
Permutation test:  84%|████████▍ | 840/1000 [00:02<00:00, 384.22 permutations/s]
Permutation test:  88%|████████▊ | 879/1000 [00:02<00:00, 382.82 permutations/s]
Permutation test:  92%|█████████▏| 918/1000 [00:02<00:00, 380.76 permutations/s]
Permutation test:  96%|█████████▌| 957/1000 [00:02<00:00, 380.04 permutations/s]
Permutation test: 100%|█████████▉| 996/1000 [00:02<00:00, 380.27 permutations/s]
Permutation test: 100%|██████████| 1000/1000 [00:02<00:00, 374.88 permutations/s]

Compared to the max(t) approach above:

  1. Clusters tend to be larger, because an uncorrected p = .05 (the cluster forming threshold) usually corresponds to a lower t-value than a corrected p = .05.

  2. A second, later cluster emerged, showing that this test can be more powerful when effects are temporally and spatially extended.

Because clusters are formed before computing the permutation distribution, there are usually many non-significant clusters (we don not want to list them all here):

result.find_clusters().head()
id tstart tstop duration n_sensors v p sig
1 -0.05 -0.04 0.01 1 4.6601 1
2 0.06 0.065 0.005 1 1.9985 1
3 0.495 0.505 0.01 1 4.5273 1
4 -0.075 -0.07 0.005 1 2.0153 1
5 0.01 0.015 0.005 1 2.1638 1
6 -0.095 -0.07 0.025 2 14.389 1
7 -0.05 -0.04 0.01 2 10.504 1
8 -0.1 -0.095 0.005 1 2.2199 1
9 0.01 0.015 0.005 2 4.7805 1
11 0.195 0.2 0.005 1 2.027 1


List only significant clusters

result.find_clusters(pmin=0.05)
id tstart tstop duration n_sensors v p sig
51 0.08 0.185 0.105 19 1172.9 0 ***
80 0.235 0.32 0.085 10 187.36 0.031 *
192 0.07 0.185 0.115 37 -2684.1 0 ***
194 0.215 0.33 0.115 27 -400.95 0.003 **


Threshold-free cluster enhancement (TFCE)

TFCE is an image processing algorithm that enhances cluster-like features, but without setting an arbitrary threshold. It thus combines the advantage the max statistic approach (not having to set an arbitrary threshold) with the advantage of the cluster-based test of increased sensitivity for effects that are extended in space and time.

result = testnd.TTestOneSample(eeg, samples=1000, tfce=True)
p = plot.TopoButterfly(result, t=0.13, head_radius=0.35)
permutation statistics
Permutation test:   0%|          | 0/1000 [00:00<?, ? permutations/s]
Permutation test:   0%|          | 5/1000 [00:00<00:22, 44.23 permutations/s]
Permutation test:   1%|          | 11/1000 [00:00<00:19, 50.49 permutations/s]
Permutation test:   2%|▏         | 17/1000 [00:00<00:18, 53.00 permutations/s]
Permutation test:   2%|▏         | 23/1000 [00:00<00:17, 54.54 permutations/s]
Permutation test:   3%|▎         | 29/1000 [00:00<00:17, 54.94 permutations/s]
Permutation test:   4%|▎         | 35/1000 [00:00<00:17, 55.10 permutations/s]
Permutation test:   4%|▍         | 41/1000 [00:00<00:17, 55.08 permutations/s]
Permutation test:   5%|▍         | 47/1000 [00:00<00:17, 55.32 permutations/s]
Permutation test:   5%|▌         | 53/1000 [00:00<00:17, 55.45 permutations/s]
Permutation test:   6%|▌         | 59/1000 [00:01<00:16, 56.02 permutations/s]
Permutation test:   6%|▋         | 65/1000 [00:01<00:16, 55.81 permutations/s]
Permutation test:   7%|▋         | 71/1000 [00:01<00:16, 55.77 permutations/s]
Permutation test:   8%|▊         | 77/1000 [00:01<00:16, 54.85 permutations/s]
Permutation test:   8%|▊         | 83/1000 [00:01<00:16, 55.77 permutations/s]
Permutation test:   9%|▉         | 89/1000 [00:01<00:16, 55.44 permutations/s]
Permutation test:  10%|▉         | 95/1000 [00:01<00:16, 55.28 permutations/s]
Permutation test:  10%|█         | 101/1000 [00:01<00:16, 54.98 permutations/s]
Permutation test:  11%|█         | 107/1000 [00:01<00:16, 54.81 permutations/s]
Permutation test:  11%|█▏        | 113/1000 [00:02<00:16, 52.39 permutations/s]
Permutation test:  12%|█▏        | 119/1000 [00:02<00:16, 53.32 permutations/s]
Permutation test:  12%|█▎        | 125/1000 [00:02<00:16, 53.66 permutations/s]
Permutation test:  13%|█▎        | 131/1000 [00:02<00:16, 54.18 permutations/s]
Permutation test:  14%|█▎        | 137/1000 [00:02<00:15, 54.29 permutations/s]
Permutation test:  14%|█▍        | 143/1000 [00:02<00:15, 54.40 permutations/s]
Permutation test:  15%|█▍        | 149/1000 [00:02<00:15, 55.18 permutations/s]
Permutation test:  16%|█▌        | 155/1000 [00:02<00:15, 55.59 permutations/s]
Permutation test:  16%|█▌        | 161/1000 [00:02<00:15, 55.93 permutations/s]
Permutation test:  17%|█▋        | 167/1000 [00:03<00:14, 55.77 permutations/s]
Permutation test:  17%|█▋        | 173/1000 [00:03<00:14, 55.69 permutations/s]
Permutation test:  18%|█▊        | 179/1000 [00:03<00:14, 56.13 permutations/s]
Permutation test:  18%|█▊        | 185/1000 [00:03<00:14, 56.36 permutations/s]
Permutation test:  19%|█▉        | 191/1000 [00:03<00:14, 55.97 permutations/s]
Permutation test:  20%|█▉        | 197/1000 [00:03<00:14, 56.28 permutations/s]
Permutation test:  20%|██        | 203/1000 [00:03<00:14, 55.32 permutations/s]
Permutation test:  21%|██        | 209/1000 [00:03<00:14, 54.79 permutations/s]
Permutation test:  22%|██▏       | 215/1000 [00:03<00:14, 54.65 permutations/s]
Permutation test:  22%|██▏       | 221/1000 [00:04<00:14, 54.49 permutations/s]
Permutation test:  23%|██▎       | 227/1000 [00:04<00:14, 54.73 permutations/s]
Permutation test:  23%|██▎       | 233/1000 [00:04<00:14, 54.71 permutations/s]
Permutation test:  24%|██▍       | 239/1000 [00:04<00:13, 54.68 permutations/s]
Permutation test:  24%|██▍       | 245/1000 [00:04<00:13, 54.98 permutations/s]
Permutation test:  25%|██▌       | 251/1000 [00:04<00:13, 55.04 permutations/s]
Permutation test:  26%|██▌       | 257/1000 [00:04<00:13, 54.68 permutations/s]
Permutation test:  26%|██▋       | 263/1000 [00:04<00:13, 54.57 permutations/s]
Permutation test:  27%|██▋       | 269/1000 [00:04<00:13, 55.32 permutations/s]
Permutation test:  28%|██▊       | 275/1000 [00:05<00:13, 54.41 permutations/s]
Permutation test:  28%|██▊       | 281/1000 [00:05<00:13, 52.65 permutations/s]
Permutation test:  29%|██▊       | 287/1000 [00:05<00:13, 53.66 permutations/s]
Permutation test:  29%|██▉       | 293/1000 [00:05<00:13, 53.51 permutations/s]
Permutation test:  30%|██▉       | 299/1000 [00:05<00:13, 53.84 permutations/s]
Permutation test:  30%|███       | 305/1000 [00:05<00:12, 54.18 permutations/s]
Permutation test:  31%|███       | 311/1000 [00:05<00:12, 54.34 permutations/s]
Permutation test:  32%|███▏      | 317/1000 [00:05<00:12, 54.49 permutations/s]
Permutation test:  32%|███▏      | 323/1000 [00:05<00:12, 55.33 permutations/s]
Permutation test:  33%|███▎      | 329/1000 [00:06<00:12, 55.12 permutations/s]
Permutation test:  34%|███▎      | 335/1000 [00:06<00:11, 55.46 permutations/s]
Permutation test:  34%|███▍      | 341/1000 [00:06<00:11, 55.73 permutations/s]
Permutation test:  35%|███▍      | 347/1000 [00:06<00:11, 55.31 permutations/s]
Permutation test:  35%|███▌      | 353/1000 [00:06<00:11, 55.07 permutations/s]
Permutation test:  36%|███▌      | 359/1000 [00:06<00:11, 54.81 permutations/s]
Permutation test:  36%|███▋      | 365/1000 [00:06<00:11, 54.60 permutations/s]
Permutation test:  37%|███▋      | 371/1000 [00:06<00:11, 54.87 permutations/s]
Permutation test:  38%|███▊      | 377/1000 [00:06<00:11, 55.07 permutations/s]
Permutation test:  38%|███▊      | 383/1000 [00:06<00:11, 54.55 permutations/s]
Permutation test:  39%|███▉      | 389/1000 [00:07<00:11, 54.60 permutations/s]
Permutation test:  40%|███▉      | 395/1000 [00:07<00:11, 51.45 permutations/s]
Permutation test:  40%|████      | 401/1000 [00:07<00:11, 52.52 permutations/s]
Permutation test:  41%|████      | 407/1000 [00:07<00:11, 53.31 permutations/s]
Permutation test:  41%|████▏     | 413/1000 [00:07<00:10, 54.23 permutations/s]
Permutation test:  42%|████▏     | 419/1000 [00:07<00:10, 54.89 permutations/s]
Permutation test:  42%|████▎     | 425/1000 [00:07<00:10, 55.71 permutations/s]
Permutation test:  43%|████▎     | 431/1000 [00:07<00:10, 55.20 permutations/s]
Permutation test:  44%|████▎     | 437/1000 [00:07<00:10, 54.90 permutations/s]
Permutation test:  44%|████▍     | 443/1000 [00:08<00:10, 54.80 permutations/s]
Permutation test:  45%|████▍     | 449/1000 [00:08<00:10, 54.63 permutations/s]
Permutation test:  46%|████▌     | 455/1000 [00:08<00:09, 54.74 permutations/s]
Permutation test:  46%|████▌     | 461/1000 [00:08<00:09, 55.35 permutations/s]
Permutation test:  47%|████▋     | 467/1000 [00:08<00:09, 55.40 permutations/s]
Permutation test:  47%|████▋     | 473/1000 [00:08<00:09, 54.96 permutations/s]
Permutation test:  48%|████▊     | 479/1000 [00:08<00:09, 54.72 permutations/s]
Permutation test:  48%|████▊     | 485/1000 [00:08<00:09, 53.89 permutations/s]
Permutation test:  49%|████▉     | 491/1000 [00:08<00:09, 54.45 permutations/s]
Permutation test:  50%|████▉     | 497/1000 [00:09<00:09, 53.98 permutations/s]
Permutation test:  50%|█████     | 503/1000 [00:09<00:09, 53.66 permutations/s]
Permutation test:  51%|█████     | 509/1000 [00:09<00:09, 51.77 permutations/s]
Permutation test:  52%|█████▏    | 515/1000 [00:09<00:09, 53.07 permutations/s]
Permutation test:  52%|█████▏    | 521/1000 [00:09<00:09, 53.15 permutations/s]
Permutation test:  53%|█████▎    | 527/1000 [00:09<00:08, 53.81 permutations/s]
Permutation test:  53%|█████▎    | 533/1000 [00:09<00:08, 54.42 permutations/s]
Permutation test:  54%|█████▍    | 539/1000 [00:09<00:08, 54.55 permutations/s]
Permutation test:  55%|█████▍    | 545/1000 [00:09<00:08, 54.79 permutations/s]
Permutation test:  55%|█████▌    | 551/1000 [00:10<00:08, 54.90 permutations/s]
Permutation test:  56%|█████▌    | 557/1000 [00:10<00:08, 55.33 permutations/s]
Permutation test:  56%|█████▋    | 563/1000 [00:10<00:07, 55.68 permutations/s]
Permutation test:  57%|█████▋    | 569/1000 [00:10<00:07, 55.54 permutations/s]
Permutation test:  57%|█████▊    | 575/1000 [00:10<00:07, 56.12 permutations/s]
Permutation test:  58%|█████▊    | 581/1000 [00:10<00:07, 55.63 permutations/s]
Permutation test:  59%|█████▊    | 587/1000 [00:10<00:07, 55.84 permutations/s]
Permutation test:  59%|█████▉    | 593/1000 [00:10<00:07, 55.42 permutations/s]
Permutation test:  60%|█████▉    | 599/1000 [00:10<00:07, 55.40 permutations/s]
Permutation test:  60%|██████    | 605/1000 [00:11<00:07, 55.51 permutations/s]
Permutation test:  61%|██████    | 611/1000 [00:11<00:06, 55.94 permutations/s]
Permutation test:  62%|██████▏   | 617/1000 [00:11<00:06, 55.14 permutations/s]
Permutation test:  62%|██████▏   | 623/1000 [00:11<00:06, 54.59 permutations/s]
Permutation test:  63%|██████▎   | 629/1000 [00:11<00:06, 54.96 permutations/s]
Permutation test:  64%|██████▎   | 635/1000 [00:11<00:06, 55.41 permutations/s]
Permutation test:  64%|██████▍   | 641/1000 [00:11<00:06, 54.59 permutations/s]
Permutation test:  65%|██████▍   | 647/1000 [00:11<00:06, 55.05 permutations/s]
Permutation test:  65%|██████▌   | 653/1000 [00:11<00:06, 54.73 permutations/s]
Permutation test:  66%|██████▌   | 659/1000 [00:12<00:06, 54.54 permutations/s]
Permutation test:  66%|██████▋   | 665/1000 [00:12<00:06, 55.11 permutations/s]
Permutation test:  67%|██████▋   | 671/1000 [00:12<00:06, 53.48 permutations/s]
Permutation test:  68%|██████▊   | 677/1000 [00:12<00:06, 53.20 permutations/s]
Permutation test:  68%|██████▊   | 683/1000 [00:12<00:05, 54.39 permutations/s]
Permutation test:  69%|██████▉   | 689/1000 [00:12<00:05, 54.25 permutations/s]
Permutation test:  70%|██████▉   | 695/1000 [00:12<00:05, 54.95 permutations/s]
Permutation test:  70%|███████   | 701/1000 [00:12<00:05, 55.34 permutations/s]
Permutation test:  71%|███████   | 707/1000 [00:12<00:05, 55.18 permutations/s]
Permutation test:  71%|███████▏  | 713/1000 [00:13<00:05, 54.74 permutations/s]
Permutation test:  72%|███████▏  | 719/1000 [00:13<00:05, 55.22 permutations/s]
Permutation test:  72%|███████▎  | 725/1000 [00:13<00:04, 55.47 permutations/s]
Permutation test:  73%|███████▎  | 731/1000 [00:13<00:04, 54.54 permutations/s]
Permutation test:  74%|███████▎  | 737/1000 [00:13<00:04, 55.07 permutations/s]
Permutation test:  74%|███████▍  | 743/1000 [00:13<00:04, 55.54 permutations/s]
Permutation test:  75%|███████▍  | 749/1000 [00:13<00:04, 55.56 permutations/s]
Permutation test:  76%|███████▌  | 755/1000 [00:13<00:04, 54.92 permutations/s]
Permutation test:  76%|███████▌  | 761/1000 [00:13<00:04, 54.92 permutations/s]
Permutation test:  77%|███████▋  | 767/1000 [00:14<00:04, 55.33 permutations/s]
Permutation test:  77%|███████▋  | 773/1000 [00:14<00:04, 54.96 permutations/s]
Permutation test:  78%|███████▊  | 779/1000 [00:14<00:04, 54.51 permutations/s]
Permutation test:  78%|███████▊  | 785/1000 [00:14<00:03, 54.62 permutations/s]
Permutation test:  79%|███████▉  | 791/1000 [00:14<00:03, 55.55 permutations/s]
Permutation test:  80%|███████▉  | 797/1000 [00:14<00:03, 55.20 permutations/s]
Permutation test:  80%|████████  | 803/1000 [00:14<00:03, 54.82 permutations/s]
Permutation test:  81%|████████  | 809/1000 [00:14<00:03, 54.53 permutations/s]
Permutation test:  82%|████████▏ | 815/1000 [00:14<00:03, 53.84 permutations/s]
Permutation test:  82%|████████▏ | 821/1000 [00:15<00:03, 53.39 permutations/s]
Permutation test:  83%|████████▎ | 827/1000 [00:15<00:03, 53.81 permutations/s]
Permutation test:  83%|████████▎ | 833/1000 [00:15<00:03, 52.98 permutations/s]
Permutation test:  84%|████████▍ | 839/1000 [00:15<00:03, 53.00 permutations/s]
Permutation test:  84%|████████▍ | 845/1000 [00:15<00:02, 54.20 permutations/s]
Permutation test:  85%|████████▌ | 851/1000 [00:15<00:02, 55.09 permutations/s]
Permutation test:  86%|████████▌ | 857/1000 [00:15<00:02, 55.17 permutations/s]
Permutation test:  86%|████████▋ | 863/1000 [00:15<00:02, 56.09 permutations/s]
Permutation test:  87%|████████▋ | 869/1000 [00:15<00:02, 56.15 permutations/s]
Permutation test:  88%|████████▊ | 875/1000 [00:15<00:02, 55.72 permutations/s]
Permutation test:  88%|████████▊ | 881/1000 [00:16<00:02, 56.12 permutations/s]
Permutation test:  89%|████████▊ | 887/1000 [00:16<00:02, 55.94 permutations/s]
Permutation test:  89%|████████▉ | 893/1000 [00:16<00:01, 55.51 permutations/s]
Permutation test:  90%|████████▉ | 899/1000 [00:16<00:01, 55.74 permutations/s]
Permutation test:  90%|█████████ | 905/1000 [00:16<00:01, 55.76 permutations/s]
Permutation test:  91%|█████████ | 911/1000 [00:16<00:01, 55.97 permutations/s]
Permutation test:  92%|█████████▏| 917/1000 [00:16<00:01, 55.82 permutations/s]
Permutation test:  92%|█████████▏| 923/1000 [00:16<00:01, 56.09 permutations/s]
Permutation test:  93%|█████████▎| 929/1000 [00:16<00:01, 56.22 permutations/s]
Permutation test:  94%|█████████▎| 935/1000 [00:17<00:01, 55.38 permutations/s]
Permutation test:  94%|█████████▍| 941/1000 [00:17<00:01, 55.58 permutations/s]
Permutation test:  95%|█████████▍| 947/1000 [00:17<00:00, 55.89 permutations/s]
Permutation test:  95%|█████████▌| 953/1000 [00:17<00:00, 56.14 permutations/s]
Permutation test:  96%|█████████▌| 959/1000 [00:17<00:00, 55.59 permutations/s]
Permutation test:  96%|█████████▋| 965/1000 [00:17<00:00, 55.56 permutations/s]
Permutation test:  97%|█████████▋| 971/1000 [00:17<00:00, 56.09 permutations/s]
Permutation test:  98%|█████████▊| 977/1000 [00:17<00:00, 55.55 permutations/s]
Permutation test:  98%|█████████▊| 983/1000 [00:17<00:00, 55.58 permutations/s]
Permutation test:  99%|█████████▉| 989/1000 [00:18<00:00, 56.18 permutations/s]
Permutation test: 100%|█████████▉| 995/1000 [00:18<00:00, 56.10 permutations/s]
Permutation test: 100%|██████████| 1000/1000 [00:18<00:00, 54.89 permutations/s]

Result representation is analogous to the max statistic approach, with the addition that the TFCE map can be visualized:

p = plot.TopoButterfly(result.tfce_map, t=0.13, head_radius=0.35)
permutation statistics

Total running time of the script: (0 minutes 26.575 seconds)

Gallery generated by Sphinx-Gallery