One Way manova

One way manova to compare Left vs Right.

import seaborn as sns

from time import time
from matplotlib import pyplot as plt

from mne import Epochs, pick_types, events_from_annotations
from mne.io import concatenate_raws
from mne.io.edf import read_raw_edf
from mne.datasets import eegbci

from pyriemann.stats import PermutationDistance, PermutationModel
from pyriemann.estimation import Covariances
from pyriemann.spatialfilters import CSP

from sklearn.pipeline import make_pipeline
from sklearn.linear_model import LogisticRegression

sns.set_style('whitegrid')

Set parameters and read data

# avoid classification of evoked responses by using epochs that start 1s after
# cue onset.
tmin, tmax = 1., 3.
event_id = dict(hands=2, feet=3)
subject = 1
runs = [6, 10, 14]  # motor imagery: hands vs feet

raw_files = [
    read_raw_edf(f, preload=True, verbose=False)
    for f in eegbci.load_data(subject, runs)
]
raw = concatenate_raws(raw_files)

# Apply band-pass filter
raw.filter(7., 35., method='iir')

events, _ = events_from_annotations(raw, event_id=dict(T1=2, T2=3))

picks = pick_types(
    raw.info, meg=False, eeg=True, stim=False, eog=False, exclude='bads')
picks = picks[::4]

# Read epochs (train will be done only between 1 and 2s)
# Testing will be done with a running classifier
epochs = Epochs(
    raw,
    events,
    event_id,
    tmin,
    tmax,
    proj=True,
    picks=picks,
    baseline=None,
    preload=True,
    verbose=False)
labels = epochs.events[:, -1] - 2

# get epochs
epochs_data = epochs.get_data()

# compute covariance matrices
covmats = Covariances().fit_transform(epochs_data)

n_perms = 500
Filtering raw data in 3 contiguous segments
Setting up band-pass filter from 7 - 35 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 7.00, 35.00 Hz: -6.02, -6.02 dB

Used Annotations descriptions: ['T1', 'T2']

Pairwise distance based permutation test

t_init = time()
p_test = PermutationDistance(n_perms, metric='riemann', mode='pairwise')
p, F = p_test.test(covmats, labels)
duration = time() - t_init

fig, axes = plt.subplots(1, 1, figsize=[6, 3], sharey=True)
p_test.plot(nbins=10, axes=axes)
plt.title('Pairwise distance - %.2f sec.' % duration)
print('p-value: %.3f' % p)
sns.despine()
plt.tight_layout()
plt.show()
Pairwise distance - 0.26 sec.
Performing permutations : [0.2%]
Performing permutations : [0.4%]
Performing permutations : [0.6%]
Performing permutations : [0.8%]
Performing permutations : [1.0%]
Performing permutations : [1.2%]
Performing permutations : [1.4%]
Performing permutations : [1.6%]
Performing permutations : [1.8%]
Performing permutations : [2.0%]
Performing permutations : [2.2%]
Performing permutations : [2.4%]
Performing permutations : [2.6%]
Performing permutations : [2.8%]
Performing permutations : [3.0%]
Performing permutations : [3.2%]
Performing permutations : [3.4%]
Performing permutations : [3.6%]
Performing permutations : [3.8%]
Performing permutations : [4.0%]
Performing permutations : [4.2%]
Performing permutations : [4.4%]
Performing permutations : [4.6%]
Performing permutations : [4.8%]
Performing permutations : [5.0%]
Performing permutations : [5.2%]
Performing permutations : [5.4%]
Performing permutations : [5.6%]
Performing permutations : [5.8%]
Performing permutations : [6.0%]
Performing permutations : [6.2%]
Performing permutations : [6.4%]
Performing permutations : [6.6%]
Performing permutations : [6.8%]
Performing permutations : [7.0%]
Performing permutations : [7.2%]
Performing permutations : [7.4%]
Performing permutations : [7.6%]
Performing permutations : [7.8%]
Performing permutations : [8.0%]
Performing permutations : [8.2%]
Performing permutations : [8.4%]
Performing permutations : [8.6%]
Performing permutations : [8.8%]
Performing permutations : [9.0%]
Performing permutations : [9.2%]
Performing permutations : [9.4%]
Performing permutations : [9.6%]
Performing permutations : [9.8%]
Performing permutations : [10.0%]
Performing permutations : [10.2%]
Performing permutations : [10.4%]
Performing permutations : [10.6%]
Performing permutations : [10.8%]
Performing permutations : [11.0%]
Performing permutations : [11.2%]
Performing permutations : [11.4%]
Performing permutations : [11.6%]
Performing permutations : [11.8%]
Performing permutations : [12.0%]
Performing permutations : [12.2%]
Performing permutations : [12.4%]
Performing permutations : [12.6%]
Performing permutations : [12.8%]
Performing permutations : [13.0%]
Performing permutations : [13.2%]
Performing permutations : [13.4%]
Performing permutations : [13.6%]
Performing permutations : [13.8%]
Performing permutations : [14.0%]
Performing permutations : [14.2%]
Performing permutations : [14.4%]
Performing permutations : [14.6%]
Performing permutations : [14.8%]
Performing permutations : [15.0%]
Performing permutations : [15.2%]
Performing permutations : [15.4%]
Performing permutations : [15.6%]
Performing permutations : [15.8%]
Performing permutations : [16.0%]
Performing permutations : [16.2%]
Performing permutations : [16.4%]
Performing permutations : [16.6%]
Performing permutations : [16.8%]
Performing permutations : [17.0%]
Performing permutations : [17.2%]
Performing permutations : [17.4%]
Performing permutations : [17.6%]
Performing permutations : [17.8%]
Performing permutations : [18.0%]
Performing permutations : [18.2%]
Performing permutations : [18.4%]
Performing permutations : [18.6%]
Performing permutations : [18.8%]
Performing permutations : [19.0%]
Performing permutations : [19.2%]
Performing permutations : [19.4%]
Performing permutations : [19.6%]
Performing permutations : [19.8%]
Performing permutations : [20.0%]
Performing permutations : [20.2%]
Performing permutations : [20.4%]
Performing permutations : [20.6%]
Performing permutations : [20.8%]
Performing permutations : [21.0%]
Performing permutations : [21.2%]
Performing permutations : [21.4%]
Performing permutations : [21.6%]
Performing permutations : [21.8%]
Performing permutations : [22.0%]
Performing permutations : [22.2%]
Performing permutations : [22.4%]
Performing permutations : [22.6%]
Performing permutations : [22.8%]
Performing permutations : [23.0%]
Performing permutations : [23.2%]
Performing permutations : [23.4%]
Performing permutations : [23.6%]
Performing permutations : [23.8%]
Performing permutations : [24.0%]
Performing permutations : [24.2%]
Performing permutations : [24.4%]
Performing permutations : [24.6%]
Performing permutations : [24.8%]
Performing permutations : [25.0%]
Performing permutations : [25.2%]
Performing permutations : [25.4%]
Performing permutations : [25.6%]
Performing permutations : [25.8%]
Performing permutations : [26.0%]
Performing permutations : [26.2%]
Performing permutations : [26.4%]
Performing permutations : [26.6%]
Performing permutations : [26.8%]
Performing permutations : [27.0%]
Performing permutations : [27.2%]
Performing permutations : [27.4%]
Performing permutations : [27.6%]
Performing permutations : [27.8%]
Performing permutations : [28.0%]
Performing permutations : [28.2%]
Performing permutations : [28.4%]
Performing permutations : [28.6%]
Performing permutations : [28.8%]
Performing permutations : [29.0%]
Performing permutations : [29.2%]
Performing permutations : [29.4%]
Performing permutations : [29.6%]
Performing permutations : [29.8%]
Performing permutations : [30.0%]
Performing permutations : [30.2%]
Performing permutations : [30.4%]
Performing permutations : [30.6%]
Performing permutations : [30.8%]
Performing permutations : [31.0%]
Performing permutations : [31.2%]
Performing permutations : [31.4%]
Performing permutations : [31.6%]
Performing permutations : [31.8%]
Performing permutations : [32.0%]
Performing permutations : [32.2%]
Performing permutations : [32.4%]
Performing permutations : [32.6%]
Performing permutations : [32.8%]
Performing permutations : [33.0%]
Performing permutations : [33.2%]
Performing permutations : [33.4%]
Performing permutations : [33.6%]
Performing permutations : [33.8%]
Performing permutations : [34.0%]
Performing permutations : [34.2%]
Performing permutations : [34.4%]
Performing permutations : [34.6%]
Performing permutations : [34.8%]
Performing permutations : [35.0%]
Performing permutations : [35.2%]
Performing permutations : [35.4%]
Performing permutations : [35.6%]
Performing permutations : [35.8%]
Performing permutations : [36.0%]
Performing permutations : [36.2%]
Performing permutations : [36.4%]
Performing permutations : [36.6%]
Performing permutations : [36.8%]
Performing permutations : [37.0%]
Performing permutations : [37.2%]
Performing permutations : [37.4%]
Performing permutations : [37.6%]
Performing permutations : [37.8%]
Performing permutations : [38.0%]
Performing permutations : [38.2%]
Performing permutations : [38.4%]
Performing permutations : [38.6%]
Performing permutations : [38.8%]
Performing permutations : [39.0%]
Performing permutations : [39.2%]
Performing permutations : [39.4%]
Performing permutations : [39.6%]
Performing permutations : [39.8%]
Performing permutations : [40.0%]
Performing permutations : [40.2%]
Performing permutations : [40.4%]
Performing permutations : [40.6%]
Performing permutations : [40.8%]
Performing permutations : [41.0%]
Performing permutations : [41.2%]
Performing permutations : [41.4%]
Performing permutations : [41.6%]
Performing permutations : [41.8%]
Performing permutations : [42.0%]
Performing permutations : [42.2%]
Performing permutations : [42.4%]
Performing permutations : [42.6%]
Performing permutations : [42.8%]
Performing permutations : [43.0%]
Performing permutations : [43.2%]
Performing permutations : [43.4%]
Performing permutations : [43.6%]
Performing permutations : [43.8%]
Performing permutations : [44.0%]
Performing permutations : [44.2%]
Performing permutations : [44.4%]
Performing permutations : [44.6%]
Performing permutations : [44.8%]
Performing permutations : [45.0%]
Performing permutations : [45.2%]
Performing permutations : [45.4%]
Performing permutations : [45.6%]
Performing permutations : [45.8%]
Performing permutations : [46.0%]
Performing permutations : [46.2%]
Performing permutations : [46.4%]
Performing permutations : [46.6%]
Performing permutations : [46.8%]
Performing permutations : [47.0%]
Performing permutations : [47.2%]
Performing permutations : [47.4%]
Performing permutations : [47.6%]
Performing permutations : [47.8%]
Performing permutations : [48.0%]
Performing permutations : [48.2%]
Performing permutations : [48.4%]
Performing permutations : [48.6%]
Performing permutations : [48.8%]
Performing permutations : [49.0%]
Performing permutations : [49.2%]
Performing permutations : [49.4%]
Performing permutations : [49.6%]
Performing permutations : [49.8%]
Performing permutations : [50.0%]
Performing permutations : [50.2%]
Performing permutations : [50.4%]
Performing permutations : [50.6%]
Performing permutations : [50.8%]
Performing permutations : [51.0%]
Performing permutations : [51.2%]
Performing permutations : [51.4%]
Performing permutations : [51.6%]
Performing permutations : [51.8%]
Performing permutations : [52.0%]
Performing permutations : [52.2%]
Performing permutations : [52.4%]
Performing permutations : [52.6%]
Performing permutations : [52.8%]
Performing permutations : [53.0%]
Performing permutations : [53.2%]
Performing permutations : [53.4%]
Performing permutations : [53.6%]
Performing permutations : [53.8%]
Performing permutations : [54.0%]
Performing permutations : [54.2%]
Performing permutations : [54.4%]
Performing permutations : [54.6%]
Performing permutations : [54.8%]
Performing permutations : [55.0%]
Performing permutations : [55.2%]
Performing permutations : [55.4%]
Performing permutations : [55.6%]
Performing permutations : [55.8%]
Performing permutations : [56.0%]
Performing permutations : [56.2%]
Performing permutations : [56.4%]
Performing permutations : [56.6%]
Performing permutations : [56.8%]
Performing permutations : [57.0%]
Performing permutations : [57.2%]
Performing permutations : [57.4%]
Performing permutations : [57.6%]
Performing permutations : [57.8%]
Performing permutations : [58.0%]
Performing permutations : [58.2%]
Performing permutations : [58.4%]
Performing permutations : [58.6%]
Performing permutations : [58.8%]
Performing permutations : [59.0%]
Performing permutations : [59.2%]
Performing permutations : [59.4%]
Performing permutations : [59.6%]
Performing permutations : [59.8%]
Performing permutations : [60.0%]
Performing permutations : [60.2%]
Performing permutations : [60.4%]
Performing permutations : [60.6%]
Performing permutations : [60.8%]
Performing permutations : [61.0%]
Performing permutations : [61.2%]
Performing permutations : [61.4%]
Performing permutations : [61.6%]
Performing permutations : [61.8%]
Performing permutations : [62.0%]
Performing permutations : [62.2%]
Performing permutations : [62.4%]
Performing permutations : [62.6%]
Performing permutations : [62.8%]
Performing permutations : [63.0%]
Performing permutations : [63.2%]
Performing permutations : [63.4%]
Performing permutations : [63.6%]
Performing permutations : [63.8%]
Performing permutations : [64.0%]
Performing permutations : [64.2%]
Performing permutations : [64.4%]
Performing permutations : [64.6%]
Performing permutations : [64.8%]
Performing permutations : [65.0%]
Performing permutations : [65.2%]
Performing permutations : [65.4%]
Performing permutations : [65.6%]
Performing permutations : [65.8%]
Performing permutations : [66.0%]
Performing permutations : [66.2%]
Performing permutations : [66.4%]
Performing permutations : [66.6%]
Performing permutations : [66.8%]
Performing permutations : [67.0%]
Performing permutations : [67.2%]
Performing permutations : [67.4%]
Performing permutations : [67.6%]
Performing permutations : [67.8%]
Performing permutations : [68.0%]
Performing permutations : [68.2%]
Performing permutations : [68.4%]
Performing permutations : [68.6%]
Performing permutations : [68.8%]
Performing permutations : [69.0%]
Performing permutations : [69.2%]
Performing permutations : [69.4%]
Performing permutations : [69.6%]
Performing permutations : [69.8%]
Performing permutations : [70.0%]
Performing permutations : [70.2%]
Performing permutations : [70.4%]
Performing permutations : [70.6%]
Performing permutations : [70.8%]
Performing permutations : [71.0%]
Performing permutations : [71.2%]
Performing permutations : [71.4%]
Performing permutations : [71.6%]
Performing permutations : [71.8%]
Performing permutations : [72.0%]
Performing permutations : [72.2%]
Performing permutations : [72.4%]
Performing permutations : [72.6%]
Performing permutations : [72.8%]
Performing permutations : [73.0%]
Performing permutations : [73.2%]
Performing permutations : [73.4%]
Performing permutations : [73.6%]
Performing permutations : [73.8%]
Performing permutations : [74.0%]
Performing permutations : [74.2%]
Performing permutations : [74.4%]
Performing permutations : [74.6%]
Performing permutations : [74.8%]
Performing permutations : [75.0%]
Performing permutations : [75.2%]
Performing permutations : [75.4%]
Performing permutations : [75.6%]
Performing permutations : [75.8%]
Performing permutations : [76.0%]
Performing permutations : [76.2%]
Performing permutations : [76.4%]
Performing permutations : [76.6%]
Performing permutations : [76.8%]
Performing permutations : [77.0%]
Performing permutations : [77.2%]
Performing permutations : [77.4%]
Performing permutations : [77.6%]
Performing permutations : [77.8%]
Performing permutations : [78.0%]
Performing permutations : [78.2%]
Performing permutations : [78.4%]
Performing permutations : [78.6%]
Performing permutations : [78.8%]
Performing permutations : [79.0%]
Performing permutations : [79.2%]
Performing permutations : [79.4%]
Performing permutations : [79.6%]
Performing permutations : [79.8%]
Performing permutations : [80.0%]
Performing permutations : [80.2%]
Performing permutations : [80.4%]
Performing permutations : [80.6%]
Performing permutations : [80.8%]
Performing permutations : [81.0%]
Performing permutations : [81.2%]
Performing permutations : [81.4%]
Performing permutations : [81.6%]
Performing permutations : [81.8%]
Performing permutations : [82.0%]
Performing permutations : [82.2%]
Performing permutations : [82.4%]
Performing permutations : [82.6%]
Performing permutations : [82.8%]
Performing permutations : [83.0%]
Performing permutations : [83.2%]
Performing permutations : [83.4%]
Performing permutations : [83.6%]
Performing permutations : [83.8%]
Performing permutations : [84.0%]
Performing permutations : [84.2%]
Performing permutations : [84.4%]
Performing permutations : [84.6%]
Performing permutations : [84.8%]
Performing permutations : [85.0%]
Performing permutations : [85.2%]
Performing permutations : [85.4%]
Performing permutations : [85.6%]
Performing permutations : [85.8%]
Performing permutations : [86.0%]
Performing permutations : [86.2%]
Performing permutations : [86.4%]
Performing permutations : [86.6%]
Performing permutations : [86.8%]
Performing permutations : [87.0%]
Performing permutations : [87.2%]
Performing permutations : [87.4%]
Performing permutations : [87.6%]
Performing permutations : [87.8%]
Performing permutations : [88.0%]
Performing permutations : [88.2%]
Performing permutations : [88.4%]
Performing permutations : [88.6%]
Performing permutations : [88.8%]
Performing permutations : [89.0%]
Performing permutations : [89.2%]
Performing permutations : [89.4%]
Performing permutations : [89.6%]
Performing permutations : [89.8%]
Performing permutations : [90.0%]
Performing permutations : [90.2%]
Performing permutations : [90.4%]
Performing permutations : [90.6%]
Performing permutations : [90.8%]
Performing permutations : [91.0%]
Performing permutations : [91.2%]
Performing permutations : [91.4%]
Performing permutations : [91.6%]
Performing permutations : [91.8%]
Performing permutations : [92.0%]
Performing permutations : [92.2%]
Performing permutations : [92.4%]
Performing permutations : [92.6%]
Performing permutations : [92.8%]
Performing permutations : [93.0%]
Performing permutations : [93.2%]
Performing permutations : [93.4%]
Performing permutations : [93.6%]
Performing permutations : [93.8%]
Performing permutations : [94.0%]
Performing permutations : [94.2%]
Performing permutations : [94.4%]
Performing permutations : [94.6%]
Performing permutations : [94.8%]
Performing permutations : [95.0%]
Performing permutations : [95.2%]
Performing permutations : [95.4%]
Performing permutations : [95.6%]
Performing permutations : [95.8%]
Performing permutations : [96.0%]
Performing permutations : [96.2%]
Performing permutations : [96.4%]
Performing permutations : [96.6%]
Performing permutations : [96.8%]
Performing permutations : [97.0%]
Performing permutations : [97.2%]
Performing permutations : [97.4%]
Performing permutations : [97.6%]
Performing permutations : [97.8%]
Performing permutations : [98.0%]
Performing permutations : [98.2%]
Performing permutations : [98.4%]
Performing permutations : [98.6%]
Performing permutations : [98.8%]
Performing permutations : [99.0%]
Performing permutations : [99.2%]
Performing permutations : [99.4%]
Performing permutations : [99.6%]
Performing permutations : [99.8%]
p-value: 0.002

t-test distance based permutation test

t_init = time()
p_test = PermutationDistance(n_perms, metric='riemann', mode='ttest')
p, F = p_test.test(covmats, labels)
duration = time() - t_init

fig, axes = plt.subplots(1, 1, figsize=[6, 3], sharey=True)
p_test.plot(nbins=10, axes=axes)
plt.title('t-test distance - %.2f sec.' % duration)
print('p-value: %.3f' % p)
sns.despine()
plt.tight_layout()
plt.show()
t-test distance - 42.65 sec.
Performing permutations : [0.2%]
Performing permutations : [0.4%]
Performing permutations : [0.6%]
Performing permutations : [0.8%]
Performing permutations : [1.0%]
Performing permutations : [1.2%]
Performing permutations : [1.4%]
Performing permutations : [1.6%]
Performing permutations : [1.8%]
Performing permutations : [2.0%]
Performing permutations : [2.2%]
Performing permutations : [2.4%]
Performing permutations : [2.6%]
Performing permutations : [2.8%]
Performing permutations : [3.0%]
Performing permutations : [3.2%]
Performing permutations : [3.4%]
Performing permutations : [3.6%]
Performing permutations : [3.8%]
Performing permutations : [4.0%]
Performing permutations : [4.2%]
Performing permutations : [4.4%]
Performing permutations : [4.6%]
Performing permutations : [4.8%]
Performing permutations : [5.0%]
Performing permutations : [5.2%]
Performing permutations : [5.4%]
Performing permutations : [5.6%]
Performing permutations : [5.8%]
Performing permutations : [6.0%]
Performing permutations : [6.2%]
Performing permutations : [6.4%]
Performing permutations : [6.6%]
Performing permutations : [6.8%]
Performing permutations : [7.0%]
Performing permutations : [7.2%]
Performing permutations : [7.4%]
Performing permutations : [7.6%]
Performing permutations : [7.8%]
Performing permutations : [8.0%]
Performing permutations : [8.2%]
Performing permutations : [8.4%]
Performing permutations : [8.6%]
Performing permutations : [8.8%]
Performing permutations : [9.0%]
Performing permutations : [9.2%]
Performing permutations : [9.4%]
Performing permutations : [9.6%]
Performing permutations : [9.8%]
Performing permutations : [10.0%]
Performing permutations : [10.2%]
Performing permutations : [10.4%]
Performing permutations : [10.6%]
Performing permutations : [10.8%]
Performing permutations : [11.0%]
Performing permutations : [11.2%]
Performing permutations : [11.4%]
Performing permutations : [11.6%]
Performing permutations : [11.8%]
Performing permutations : [12.0%]
Performing permutations : [12.2%]
Performing permutations : [12.4%]
Performing permutations : [12.6%]
Performing permutations : [12.8%]
Performing permutations : [13.0%]
Performing permutations : [13.2%]
Performing permutations : [13.4%]
Performing permutations : [13.6%]
Performing permutations : [13.8%]
Performing permutations : [14.0%]
Performing permutations : [14.2%]
Performing permutations : [14.4%]
Performing permutations : [14.6%]
Performing permutations : [14.8%]
Performing permutations : [15.0%]
Performing permutations : [15.2%]
Performing permutations : [15.4%]
Performing permutations : [15.6%]
Performing permutations : [15.8%]
Performing permutations : [16.0%]
Performing permutations : [16.2%]
Performing permutations : [16.4%]
Performing permutations : [16.6%]
Performing permutations : [16.8%]
Performing permutations : [17.0%]
Performing permutations : [17.2%]
Performing permutations : [17.4%]
Performing permutations : [17.6%]
Performing permutations : [17.8%]
Performing permutations : [18.0%]
Performing permutations : [18.2%]
Performing permutations : [18.4%]
Performing permutations : [18.6%]
Performing permutations : [18.8%]
Performing permutations : [19.0%]
Performing permutations : [19.2%]
Performing permutations : [19.4%]
Performing permutations : [19.6%]
Performing permutations : [19.8%]
Performing permutations : [20.0%]
Performing permutations : [20.2%]
Performing permutations : [20.4%]
Performing permutations : [20.6%]
Performing permutations : [20.8%]
Performing permutations : [21.0%]
Performing permutations : [21.2%]
Performing permutations : [21.4%]
Performing permutations : [21.6%]
Performing permutations : [21.8%]
Performing permutations : [22.0%]
Performing permutations : [22.2%]
Performing permutations : [22.4%]
Performing permutations : [22.6%]
Performing permutations : [22.8%]
Performing permutations : [23.0%]
Performing permutations : [23.2%]
Performing permutations : [23.4%]
Performing permutations : [23.6%]
Performing permutations : [23.8%]
Performing permutations : [24.0%]
Performing permutations : [24.2%]
Performing permutations : [24.4%]
Performing permutations : [24.6%]
Performing permutations : [24.8%]
Performing permutations : [25.0%]
Performing permutations : [25.2%]
Performing permutations : [25.4%]
Performing permutations : [25.6%]
Performing permutations : [25.8%]
Performing permutations : [26.0%]
Performing permutations : [26.2%]
Performing permutations : [26.4%]
Performing permutations : [26.6%]
Performing permutations : [26.8%]
Performing permutations : [27.0%]
Performing permutations : [27.2%]
Performing permutations : [27.4%]
Performing permutations : [27.6%]
Performing permutations : [27.8%]
Performing permutations : [28.0%]
Performing permutations : [28.2%]
Performing permutations : [28.4%]
Performing permutations : [28.6%]
Performing permutations : [28.8%]
Performing permutations : [29.0%]
Performing permutations : [29.2%]
Performing permutations : [29.4%]
Performing permutations : [29.6%]
Performing permutations : [29.8%]
Performing permutations : [30.0%]
Performing permutations : [30.2%]
Performing permutations : [30.4%]
Performing permutations : [30.6%]
Performing permutations : [30.8%]
Performing permutations : [31.0%]
Performing permutations : [31.2%]
Performing permutations : [31.4%]
Performing permutations : [31.6%]
Performing permutations : [31.8%]
Performing permutations : [32.0%]
Performing permutations : [32.2%]
Performing permutations : [32.4%]
Performing permutations : [32.6%]
Performing permutations : [32.8%]
Performing permutations : [33.0%]
Performing permutations : [33.2%]
Performing permutations : [33.4%]
Performing permutations : [33.6%]
Performing permutations : [33.8%]
Performing permutations : [34.0%]
Performing permutations : [34.2%]
Performing permutations : [34.4%]
Performing permutations : [34.6%]
Performing permutations : [34.8%]
Performing permutations : [35.0%]
Performing permutations : [35.2%]
Performing permutations : [35.4%]
Performing permutations : [35.6%]
Performing permutations : [35.8%]
Performing permutations : [36.0%]
Performing permutations : [36.2%]
Performing permutations : [36.4%]
Performing permutations : [36.6%]
Performing permutations : [36.8%]
Performing permutations : [37.0%]
Performing permutations : [37.2%]
Performing permutations : [37.4%]
Performing permutations : [37.6%]
Performing permutations : [37.8%]
Performing permutations : [38.0%]
Performing permutations : [38.2%]
Performing permutations : [38.4%]
Performing permutations : [38.6%]
Performing permutations : [38.8%]
Performing permutations : [39.0%]
Performing permutations : [39.2%]
Performing permutations : [39.4%]
Performing permutations : [39.6%]
Performing permutations : [39.8%]
Performing permutations : [40.0%]
Performing permutations : [40.2%]
Performing permutations : [40.4%]
Performing permutations : [40.6%]
Performing permutations : [40.8%]
Performing permutations : [41.0%]
Performing permutations : [41.2%]
Performing permutations : [41.4%]
Performing permutations : [41.6%]
Performing permutations : [41.8%]
Performing permutations : [42.0%]
Performing permutations : [42.2%]
Performing permutations : [42.4%]
Performing permutations : [42.6%]
Performing permutations : [42.8%]
Performing permutations : [43.0%]
Performing permutations : [43.2%]
Performing permutations : [43.4%]
Performing permutations : [43.6%]
Performing permutations : [43.8%]
Performing permutations : [44.0%]
Performing permutations : [44.2%]
Performing permutations : [44.4%]
Performing permutations : [44.6%]
Performing permutations : [44.8%]
Performing permutations : [45.0%]
Performing permutations : [45.2%]
Performing permutations : [45.4%]
Performing permutations : [45.6%]
Performing permutations : [45.8%]
Performing permutations : [46.0%]
Performing permutations : [46.2%]
Performing permutations : [46.4%]
Performing permutations : [46.6%]
Performing permutations : [46.8%]
Performing permutations : [47.0%]
Performing permutations : [47.2%]
Performing permutations : [47.4%]
Performing permutations : [47.6%]
Performing permutations : [47.8%]
Performing permutations : [48.0%]
Performing permutations : [48.2%]
Performing permutations : [48.4%]
Performing permutations : [48.6%]
Performing permutations : [48.8%]
Performing permutations : [49.0%]
Performing permutations : [49.2%]
Performing permutations : [49.4%]
Performing permutations : [49.6%]
Performing permutations : [49.8%]
Performing permutations : [50.0%]
Performing permutations : [50.2%]
Performing permutations : [50.4%]
Performing permutations : [50.6%]
Performing permutations : [50.8%]
Performing permutations : [51.0%]
Performing permutations : [51.2%]
Performing permutations : [51.4%]
Performing permutations : [51.6%]
Performing permutations : [51.8%]
Performing permutations : [52.0%]
Performing permutations : [52.2%]
Performing permutations : [52.4%]
Performing permutations : [52.6%]
Performing permutations : [52.8%]
Performing permutations : [53.0%]
Performing permutations : [53.2%]
Performing permutations : [53.4%]
Performing permutations : [53.6%]
Performing permutations : [53.8%]
Performing permutations : [54.0%]
Performing permutations : [54.2%]
Performing permutations : [54.4%]
Performing permutations : [54.6%]
Performing permutations : [54.8%]
Performing permutations : [55.0%]
Performing permutations : [55.2%]
Performing permutations : [55.4%]
Performing permutations : [55.6%]
Performing permutations : [55.8%]
Performing permutations : [56.0%]
Performing permutations : [56.2%]
Performing permutations : [56.4%]
Performing permutations : [56.6%]
Performing permutations : [56.8%]
Performing permutations : [57.0%]
Performing permutations : [57.2%]
Performing permutations : [57.4%]
Performing permutations : [57.6%]
Performing permutations : [57.8%]
Performing permutations : [58.0%]
Performing permutations : [58.2%]
Performing permutations : [58.4%]
Performing permutations : [58.6%]
Performing permutations : [58.8%]
Performing permutations : [59.0%]
Performing permutations : [59.2%]
Performing permutations : [59.4%]
Performing permutations : [59.6%]
Performing permutations : [59.8%]
Performing permutations : [60.0%]
Performing permutations : [60.2%]
Performing permutations : [60.4%]
Performing permutations : [60.6%]
Performing permutations : [60.8%]
Performing permutations : [61.0%]
Performing permutations : [61.2%]
Performing permutations : [61.4%]
Performing permutations : [61.6%]
Performing permutations : [61.8%]
Performing permutations : [62.0%]
Performing permutations : [62.2%]
Performing permutations : [62.4%]
Performing permutations : [62.6%]
Performing permutations : [62.8%]
Performing permutations : [63.0%]
Performing permutations : [63.2%]
Performing permutations : [63.4%]
Performing permutations : [63.6%]
Performing permutations : [63.8%]
Performing permutations : [64.0%]
Performing permutations : [64.2%]
Performing permutations : [64.4%]
Performing permutations : [64.6%]
Performing permutations : [64.8%]
Performing permutations : [65.0%]
Performing permutations : [65.2%]
Performing permutations : [65.4%]
Performing permutations : [65.6%]
Performing permutations : [65.8%]
Performing permutations : [66.0%]
Performing permutations : [66.2%]
Performing permutations : [66.4%]
Performing permutations : [66.6%]
Performing permutations : [66.8%]
Performing permutations : [67.0%]
Performing permutations : [67.2%]
Performing permutations : [67.4%]
Performing permutations : [67.6%]
Performing permutations : [67.8%]
Performing permutations : [68.0%]
Performing permutations : [68.2%]
Performing permutations : [68.4%]
Performing permutations : [68.6%]
Performing permutations : [68.8%]
Performing permutations : [69.0%]
Performing permutations : [69.2%]
Performing permutations : [69.4%]
Performing permutations : [69.6%]
Performing permutations : [69.8%]
Performing permutations : [70.0%]
Performing permutations : [70.2%]
Performing permutations : [70.4%]
Performing permutations : [70.6%]
Performing permutations : [70.8%]
Performing permutations : [71.0%]
Performing permutations : [71.2%]
Performing permutations : [71.4%]
Performing permutations : [71.6%]
Performing permutations : [71.8%]
Performing permutations : [72.0%]
Performing permutations : [72.2%]
Performing permutations : [72.4%]
Performing permutations : [72.6%]
Performing permutations : [72.8%]
Performing permutations : [73.0%]
Performing permutations : [73.2%]
Performing permutations : [73.4%]
Performing permutations : [73.6%]
Performing permutations : [73.8%]
Performing permutations : [74.0%]
Performing permutations : [74.2%]
Performing permutations : [74.4%]
Performing permutations : [74.6%]
Performing permutations : [74.8%]
Performing permutations : [75.0%]
Performing permutations : [75.2%]
Performing permutations : [75.4%]
Performing permutations : [75.6%]
Performing permutations : [75.8%]
Performing permutations : [76.0%]
Performing permutations : [76.2%]
Performing permutations : [76.4%]
Performing permutations : [76.6%]
Performing permutations : [76.8%]
Performing permutations : [77.0%]
Performing permutations : [77.2%]
Performing permutations : [77.4%]
Performing permutations : [77.6%]
Performing permutations : [77.8%]
Performing permutations : [78.0%]
Performing permutations : [78.2%]
Performing permutations : [78.4%]
Performing permutations : [78.6%]
Performing permutations : [78.8%]
Performing permutations : [79.0%]
Performing permutations : [79.2%]
Performing permutations : [79.4%]
Performing permutations : [79.6%]
Performing permutations : [79.8%]
Performing permutations : [80.0%]
Performing permutations : [80.2%]
Performing permutations : [80.4%]
Performing permutations : [80.6%]
Performing permutations : [80.8%]
Performing permutations : [81.0%]
Performing permutations : [81.2%]
Performing permutations : [81.4%]
Performing permutations : [81.6%]
Performing permutations : [81.8%]
Performing permutations : [82.0%]
Performing permutations : [82.2%]
Performing permutations : [82.4%]
Performing permutations : [82.6%]
Performing permutations : [82.8%]
Performing permutations : [83.0%]
Performing permutations : [83.2%]
Performing permutations : [83.4%]
Performing permutations : [83.6%]
Performing permutations : [83.8%]
Performing permutations : [84.0%]
Performing permutations : [84.2%]
Performing permutations : [84.4%]
Performing permutations : [84.6%]
Performing permutations : [84.8%]
Performing permutations : [85.0%]
Performing permutations : [85.2%]
Performing permutations : [85.4%]
Performing permutations : [85.6%]
Performing permutations : [85.8%]
Performing permutations : [86.0%]
Performing permutations : [86.2%]
Performing permutations : [86.4%]
Performing permutations : [86.6%]
Performing permutations : [86.8%]
Performing permutations : [87.0%]
Performing permutations : [87.2%]
Performing permutations : [87.4%]
Performing permutations : [87.6%]
Performing permutations : [87.8%]
Performing permutations : [88.0%]
Performing permutations : [88.2%]
Performing permutations : [88.4%]
Performing permutations : [88.6%]
Performing permutations : [88.8%]
Performing permutations : [89.0%]
Performing permutations : [89.2%]
Performing permutations : [89.4%]
Performing permutations : [89.6%]
Performing permutations : [89.8%]
Performing permutations : [90.0%]
Performing permutations : [90.2%]
Performing permutations : [90.4%]
Performing permutations : [90.6%]
Performing permutations : [90.8%]
Performing permutations : [91.0%]
Performing permutations : [91.2%]
Performing permutations : [91.4%]
Performing permutations : [91.6%]
Performing permutations : [91.8%]
Performing permutations : [92.0%]
Performing permutations : [92.2%]
Performing permutations : [92.4%]
Performing permutations : [92.6%]
Performing permutations : [92.8%]
Performing permutations : [93.0%]
Performing permutations : [93.2%]
Performing permutations : [93.4%]
Performing permutations : [93.6%]
Performing permutations : [93.8%]
Performing permutations : [94.0%]
Performing permutations : [94.2%]
Performing permutations : [94.4%]
Performing permutations : [94.6%]
Performing permutations : [94.8%]
Performing permutations : [95.0%]
Performing permutations : [95.2%]
Performing permutations : [95.4%]
Performing permutations : [95.6%]
Performing permutations : [95.8%]
Performing permutations : [96.0%]
Performing permutations : [96.2%]
Performing permutations : [96.4%]
Performing permutations : [96.6%]
Performing permutations : [96.8%]
Performing permutations : [97.0%]
Performing permutations : [97.2%]
Performing permutations : [97.4%]
Performing permutations : [97.6%]
Performing permutations : [97.8%]
Performing permutations : [98.0%]
Performing permutations : [98.2%]
Performing permutations : [98.4%]
Performing permutations : [98.6%]
Performing permutations : [98.8%]
Performing permutations : [99.0%]
Performing permutations : [99.2%]
Performing permutations : [99.4%]
Performing permutations : [99.6%]
Performing permutations : [99.8%]
p-value: 0.002

F-test distance based permutation test

t_init = time()
p_test = PermutationDistance(n_perms, metric='riemann', mode='ftest')
p, F = p_test.test(covmats, labels)
duration = time() - t_init

fig, axes = plt.subplots(1, 1, figsize=[6, 3], sharey=True)
p_test.plot(nbins=10, axes=axes)
plt.title('F-test distance - %.2f sec.' % duration)
print('p-value: %.3f' % p)
sns.despine()
plt.tight_layout()
plt.show()
F-test distance - 42.71 sec.
Performing permutations : [0.2%]
Performing permutations : [0.4%]
Performing permutations : [0.6%]
Performing permutations : [0.8%]
Performing permutations : [1.0%]
Performing permutations : [1.2%]
Performing permutations : [1.4%]
Performing permutations : [1.6%]
Performing permutations : [1.8%]
Performing permutations : [2.0%]
Performing permutations : [2.2%]
Performing permutations : [2.4%]
Performing permutations : [2.6%]
Performing permutations : [2.8%]
Performing permutations : [3.0%]
Performing permutations : [3.2%]
Performing permutations : [3.4%]
Performing permutations : [3.6%]
Performing permutations : [3.8%]
Performing permutations : [4.0%]
Performing permutations : [4.2%]
Performing permutations : [4.4%]
Performing permutations : [4.6%]
Performing permutations : [4.8%]
Performing permutations : [5.0%]
Performing permutations : [5.2%]
Performing permutations : [5.4%]
Performing permutations : [5.6%]
Performing permutations : [5.8%]
Performing permutations : [6.0%]
Performing permutations : [6.2%]
Performing permutations : [6.4%]
Performing permutations : [6.6%]
Performing permutations : [6.8%]
Performing permutations : [7.0%]
Performing permutations : [7.2%]
Performing permutations : [7.4%]
Performing permutations : [7.6%]
Performing permutations : [7.8%]
Performing permutations : [8.0%]
Performing permutations : [8.2%]
Performing permutations : [8.4%]
Performing permutations : [8.6%]
Performing permutations : [8.8%]
Performing permutations : [9.0%]
Performing permutations : [9.2%]
Performing permutations : [9.4%]
Performing permutations : [9.6%]
Performing permutations : [9.8%]
Performing permutations : [10.0%]
Performing permutations : [10.2%]
Performing permutations : [10.4%]
Performing permutations : [10.6%]
Performing permutations : [10.8%]
Performing permutations : [11.0%]
Performing permutations : [11.2%]
Performing permutations : [11.4%]
Performing permutations : [11.6%]
Performing permutations : [11.8%]
Performing permutations : [12.0%]
Performing permutations : [12.2%]
Performing permutations : [12.4%]
Performing permutations : [12.6%]
Performing permutations : [12.8%]
Performing permutations : [13.0%]
Performing permutations : [13.2%]
Performing permutations : [13.4%]
Performing permutations : [13.6%]
Performing permutations : [13.8%]
Performing permutations : [14.0%]
Performing permutations : [14.2%]
Performing permutations : [14.4%]
Performing permutations : [14.6%]
Performing permutations : [14.8%]
Performing permutations : [15.0%]
Performing permutations : [15.2%]
Performing permutations : [15.4%]
Performing permutations : [15.6%]
Performing permutations : [15.8%]
Performing permutations : [16.0%]
Performing permutations : [16.2%]
Performing permutations : [16.4%]
Performing permutations : [16.6%]
Performing permutations : [16.8%]
Performing permutations : [17.0%]
Performing permutations : [17.2%]
Performing permutations : [17.4%]
Performing permutations : [17.6%]
Performing permutations : [17.8%]
Performing permutations : [18.0%]
Performing permutations : [18.2%]
Performing permutations : [18.4%]
Performing permutations : [18.6%]
Performing permutations : [18.8%]
Performing permutations : [19.0%]
Performing permutations : [19.2%]
Performing permutations : [19.4%]
Performing permutations : [19.6%]
Performing permutations : [19.8%]
Performing permutations : [20.0%]
Performing permutations : [20.2%]
Performing permutations : [20.4%]
Performing permutations : [20.6%]
Performing permutations : [20.8%]
Performing permutations : [21.0%]
Performing permutations : [21.2%]
Performing permutations : [21.4%]
Performing permutations : [21.6%]
Performing permutations : [21.8%]
Performing permutations : [22.0%]
Performing permutations : [22.2%]
Performing permutations : [22.4%]
Performing permutations : [22.6%]
Performing permutations : [22.8%]
Performing permutations : [23.0%]
Performing permutations : [23.2%]
Performing permutations : [23.4%]
Performing permutations : [23.6%]
Performing permutations : [23.8%]
Performing permutations : [24.0%]
Performing permutations : [24.2%]
Performing permutations : [24.4%]
Performing permutations : [24.6%]
Performing permutations : [24.8%]
Performing permutations : [25.0%]
Performing permutations : [25.2%]
Performing permutations : [25.4%]
Performing permutations : [25.6%]
Performing permutations : [25.8%]
Performing permutations : [26.0%]
Performing permutations : [26.2%]
Performing permutations : [26.4%]
Performing permutations : [26.6%]
Performing permutations : [26.8%]
Performing permutations : [27.0%]
Performing permutations : [27.2%]
Performing permutations : [27.4%]
Performing permutations : [27.6%]
Performing permutations : [27.8%]
Performing permutations : [28.0%]
Performing permutations : [28.2%]
Performing permutations : [28.4%]
Performing permutations : [28.6%]
Performing permutations : [28.8%]
Performing permutations : [29.0%]
Performing permutations : [29.2%]
Performing permutations : [29.4%]
Performing permutations : [29.6%]
Performing permutations : [29.8%]
Performing permutations : [30.0%]
Performing permutations : [30.2%]
Performing permutations : [30.4%]
Performing permutations : [30.6%]
Performing permutations : [30.8%]
Performing permutations : [31.0%]
Performing permutations : [31.2%]
Performing permutations : [31.4%]
Performing permutations : [31.6%]
Performing permutations : [31.8%]
Performing permutations : [32.0%]
Performing permutations : [32.2%]
Performing permutations : [32.4%]
Performing permutations : [32.6%]
Performing permutations : [32.8%]
Performing permutations : [33.0%]
Performing permutations : [33.2%]
Performing permutations : [33.4%]
Performing permutations : [33.6%]
Performing permutations : [33.8%]
Performing permutations : [34.0%]
Performing permutations : [34.2%]
Performing permutations : [34.4%]
Performing permutations : [34.6%]
Performing permutations : [34.8%]
Performing permutations : [35.0%]
Performing permutations : [35.2%]
Performing permutations : [35.4%]
Performing permutations : [35.6%]
Performing permutations : [35.8%]
Performing permutations : [36.0%]
Performing permutations : [36.2%]
Performing permutations : [36.4%]
Performing permutations : [36.6%]
Performing permutations : [36.8%]
Performing permutations : [37.0%]
Performing permutations : [37.2%]
Performing permutations : [37.4%]
Performing permutations : [37.6%]
Performing permutations : [37.8%]
Performing permutations : [38.0%]
Performing permutations : [38.2%]
Performing permutations : [38.4%]
Performing permutations : [38.6%]
Performing permutations : [38.8%]
Performing permutations : [39.0%]
Performing permutations : [39.2%]
Performing permutations : [39.4%]
Performing permutations : [39.6%]
Performing permutations : [39.8%]
Performing permutations : [40.0%]
Performing permutations : [40.2%]
Performing permutations : [40.4%]
Performing permutations : [40.6%]
Performing permutations : [40.8%]
Performing permutations : [41.0%]
Performing permutations : [41.2%]
Performing permutations : [41.4%]
Performing permutations : [41.6%]
Performing permutations : [41.8%]
Performing permutations : [42.0%]
Performing permutations : [42.2%]
Performing permutations : [42.4%]
Performing permutations : [42.6%]
Performing permutations : [42.8%]
Performing permutations : [43.0%]
Performing permutations : [43.2%]
Performing permutations : [43.4%]
Performing permutations : [43.6%]
Performing permutations : [43.8%]
Performing permutations : [44.0%]
Performing permutations : [44.2%]
Performing permutations : [44.4%]
Performing permutations : [44.6%]
Performing permutations : [44.8%]
Performing permutations : [45.0%]
Performing permutations : [45.2%]
Performing permutations : [45.4%]
Performing permutations : [45.6%]
Performing permutations : [45.8%]
Performing permutations : [46.0%]
Performing permutations : [46.2%]
Performing permutations : [46.4%]
Performing permutations : [46.6%]
Performing permutations : [46.8%]
Performing permutations : [47.0%]
Performing permutations : [47.2%]
Performing permutations : [47.4%]
Performing permutations : [47.6%]
Performing permutations : [47.8%]
Performing permutations : [48.0%]
Performing permutations : [48.2%]
Performing permutations : [48.4%]
Performing permutations : [48.6%]
Performing permutations : [48.8%]
Performing permutations : [49.0%]
Performing permutations : [49.2%]
Performing permutations : [49.4%]
Performing permutations : [49.6%]
Performing permutations : [49.8%]
Performing permutations : [50.0%]
Performing permutations : [50.2%]
Performing permutations : [50.4%]
Performing permutations : [50.6%]
Performing permutations : [50.8%]
Performing permutations : [51.0%]
Performing permutations : [51.2%]
Performing permutations : [51.4%]
Performing permutations : [51.6%]
Performing permutations : [51.8%]
Performing permutations : [52.0%]
Performing permutations : [52.2%]
Performing permutations : [52.4%]
Performing permutations : [52.6%]
Performing permutations : [52.8%]
Performing permutations : [53.0%]
Performing permutations : [53.2%]
Performing permutations : [53.4%]
Performing permutations : [53.6%]
Performing permutations : [53.8%]
Performing permutations : [54.0%]
Performing permutations : [54.2%]
Performing permutations : [54.4%]
Performing permutations : [54.6%]
Performing permutations : [54.8%]
Performing permutations : [55.0%]
Performing permutations : [55.2%]
Performing permutations : [55.4%]
Performing permutations : [55.6%]
Performing permutations : [55.8%]
Performing permutations : [56.0%]
Performing permutations : [56.2%]
Performing permutations : [56.4%]
Performing permutations : [56.6%]
Performing permutations : [56.8%]
Performing permutations : [57.0%]
Performing permutations : [57.2%]
Performing permutations : [57.4%]
Performing permutations : [57.6%]
Performing permutations : [57.8%]
Performing permutations : [58.0%]
Performing permutations : [58.2%]
Performing permutations : [58.4%]
Performing permutations : [58.6%]
Performing permutations : [58.8%]
Performing permutations : [59.0%]
Performing permutations : [59.2%]
Performing permutations : [59.4%]
Performing permutations : [59.6%]
Performing permutations : [59.8%]
Performing permutations : [60.0%]
Performing permutations : [60.2%]
Performing permutations : [60.4%]
Performing permutations : [60.6%]
Performing permutations : [60.8%]
Performing permutations : [61.0%]
Performing permutations : [61.2%]
Performing permutations : [61.4%]
Performing permutations : [61.6%]
Performing permutations : [61.8%]
Performing permutations : [62.0%]
Performing permutations : [62.2%]
Performing permutations : [62.4%]
Performing permutations : [62.6%]
Performing permutations : [62.8%]
Performing permutations : [63.0%]
Performing permutations : [63.2%]
Performing permutations : [63.4%]
Performing permutations : [63.6%]
Performing permutations : [63.8%]
Performing permutations : [64.0%]
Performing permutations : [64.2%]
Performing permutations : [64.4%]
Performing permutations : [64.6%]
Performing permutations : [64.8%]
Performing permutations : [65.0%]
Performing permutations : [65.2%]
Performing permutations : [65.4%]
Performing permutations : [65.6%]
Performing permutations : [65.8%]
Performing permutations : [66.0%]
Performing permutations : [66.2%]
Performing permutations : [66.4%]
Performing permutations : [66.6%]
Performing permutations : [66.8%]
Performing permutations : [67.0%]
Performing permutations : [67.2%]
Performing permutations : [67.4%]
Performing permutations : [67.6%]
Performing permutations : [67.8%]
Performing permutations : [68.0%]
Performing permutations : [68.2%]
Performing permutations : [68.4%]
Performing permutations : [68.6%]
Performing permutations : [68.8%]
Performing permutations : [69.0%]
Performing permutations : [69.2%]
Performing permutations : [69.4%]
Performing permutations : [69.6%]
Performing permutations : [69.8%]
Performing permutations : [70.0%]
Performing permutations : [70.2%]
Performing permutations : [70.4%]
Performing permutations : [70.6%]
Performing permutations : [70.8%]
Performing permutations : [71.0%]
Performing permutations : [71.2%]
Performing permutations : [71.4%]
Performing permutations : [71.6%]
Performing permutations : [71.8%]
Performing permutations : [72.0%]
Performing permutations : [72.2%]
Performing permutations : [72.4%]
Performing permutations : [72.6%]
Performing permutations : [72.8%]
Performing permutations : [73.0%]
Performing permutations : [73.2%]
Performing permutations : [73.4%]
Performing permutations : [73.6%]
Performing permutations : [73.8%]
Performing permutations : [74.0%]
Performing permutations : [74.2%]
Performing permutations : [74.4%]
Performing permutations : [74.6%]
Performing permutations : [74.8%]
Performing permutations : [75.0%]
Performing permutations : [75.2%]
Performing permutations : [75.4%]
Performing permutations : [75.6%]
Performing permutations : [75.8%]
Performing permutations : [76.0%]
Performing permutations : [76.2%]
Performing permutations : [76.4%]
Performing permutations : [76.6%]
Performing permutations : [76.8%]
Performing permutations : [77.0%]
Performing permutations : [77.2%]
Performing permutations : [77.4%]
Performing permutations : [77.6%]
Performing permutations : [77.8%]
Performing permutations : [78.0%]
Performing permutations : [78.2%]
Performing permutations : [78.4%]
Performing permutations : [78.6%]
Performing permutations : [78.8%]
Performing permutations : [79.0%]
Performing permutations : [79.2%]
Performing permutations : [79.4%]
Performing permutations : [79.6%]
Performing permutations : [79.8%]
Performing permutations : [80.0%]
Performing permutations : [80.2%]
Performing permutations : [80.4%]
Performing permutations : [80.6%]
Performing permutations : [80.8%]
Performing permutations : [81.0%]
Performing permutations : [81.2%]
Performing permutations : [81.4%]
Performing permutations : [81.6%]
Performing permutations : [81.8%]
Performing permutations : [82.0%]
Performing permutations : [82.2%]
Performing permutations : [82.4%]
Performing permutations : [82.6%]
Performing permutations : [82.8%]
Performing permutations : [83.0%]
Performing permutations : [83.2%]
Performing permutations : [83.4%]
Performing permutations : [83.6%]
Performing permutations : [83.8%]
Performing permutations : [84.0%]
Performing permutations : [84.2%]
Performing permutations : [84.4%]
Performing permutations : [84.6%]
Performing permutations : [84.8%]
Performing permutations : [85.0%]
Performing permutations : [85.2%]
Performing permutations : [85.4%]
Performing permutations : [85.6%]
Performing permutations : [85.8%]
Performing permutations : [86.0%]
Performing permutations : [86.2%]
Performing permutations : [86.4%]
Performing permutations : [86.6%]
Performing permutations : [86.8%]
Performing permutations : [87.0%]
Performing permutations : [87.2%]
Performing permutations : [87.4%]
Performing permutations : [87.6%]
Performing permutations : [87.8%]
Performing permutations : [88.0%]
Performing permutations : [88.2%]
Performing permutations : [88.4%]
Performing permutations : [88.6%]
Performing permutations : [88.8%]
Performing permutations : [89.0%]
Performing permutations : [89.2%]
Performing permutations : [89.4%]
Performing permutations : [89.6%]
Performing permutations : [89.8%]
Performing permutations : [90.0%]
Performing permutations : [90.2%]
Performing permutations : [90.4%]
Performing permutations : [90.6%]
Performing permutations : [90.8%]
Performing permutations : [91.0%]
Performing permutations : [91.2%]
Performing permutations : [91.4%]
Performing permutations : [91.6%]
Performing permutations : [91.8%]
Performing permutations : [92.0%]
Performing permutations : [92.2%]
Performing permutations : [92.4%]
Performing permutations : [92.6%]
Performing permutations : [92.8%]
Performing permutations : [93.0%]
Performing permutations : [93.2%]
Performing permutations : [93.4%]
Performing permutations : [93.6%]
Performing permutations : [93.8%]
Performing permutations : [94.0%]
Performing permutations : [94.2%]
Performing permutations : [94.4%]
Performing permutations : [94.6%]
Performing permutations : [94.8%]
Performing permutations : [95.0%]
Performing permutations : [95.2%]
Performing permutations : [95.4%]
Performing permutations : [95.6%]
Performing permutations : [95.8%]
Performing permutations : [96.0%]
Performing permutations : [96.2%]
Performing permutations : [96.4%]
Performing permutations : [96.6%]
Performing permutations : [96.8%]
Performing permutations : [97.0%]
Performing permutations : [97.2%]
Performing permutations : [97.4%]
Performing permutations : [97.6%]
Performing permutations : [97.8%]
Performing permutations : [98.0%]
Performing permutations : [98.2%]
Performing permutations : [98.4%]
Performing permutations : [98.6%]
Performing permutations : [98.8%]
Performing permutations : [99.0%]
Performing permutations : [99.2%]
Performing permutations : [99.4%]
Performing permutations : [99.6%]
Performing permutations : [99.8%]
p-value: 0.002

Classification based permutation test

clf = make_pipeline(CSP(4), LogisticRegression())

t_init = time()
p_test = PermutationModel(n_perms, model=clf, cv=3, scoring='roc_auc')
p, F = p_test.test(covmats, labels)
duration = time() - t_init

fig, axes = plt.subplots(1, 1, figsize=[6, 3], sharey=True)
p_test.plot(nbins=10, axes=axes)
plt.title('Classification - %.2f sec.' % duration)
print('p-value: %.3f' % p)
sns.despine()
plt.tight_layout()
plt.show()
Classification - 14.96 sec.
Performing permutations : [0.2%]
Performing permutations : [0.4%]
Performing permutations : [0.6%]
Performing permutations : [0.8%]
Performing permutations : [1.0%]
Performing permutations : [1.2%]
Performing permutations : [1.4%]
Performing permutations : [1.6%]
Performing permutations : [1.8%]
Performing permutations : [2.0%]
Performing permutations : [2.2%]
Performing permutations : [2.4%]
Performing permutations : [2.6%]
Performing permutations : [2.8%]
Performing permutations : [3.0%]
Performing permutations : [3.2%]
Performing permutations : [3.4%]
Performing permutations : [3.6%]
Performing permutations : [3.8%]
Performing permutations : [4.0%]
Performing permutations : [4.2%]
Performing permutations : [4.4%]
Performing permutations : [4.6%]
Performing permutations : [4.8%]
Performing permutations : [5.0%]
Performing permutations : [5.2%]
Performing permutations : [5.4%]
Performing permutations : [5.6%]
Performing permutations : [5.8%]
Performing permutations : [6.0%]
Performing permutations : [6.2%]
Performing permutations : [6.4%]
Performing permutations : [6.6%]
Performing permutations : [6.8%]
Performing permutations : [7.0%]
Performing permutations : [7.2%]
Performing permutations : [7.4%]
Performing permutations : [7.6%]
Performing permutations : [7.8%]
Performing permutations : [8.0%]
Performing permutations : [8.2%]
Performing permutations : [8.4%]
Performing permutations : [8.6%]
Performing permutations : [8.8%]
Performing permutations : [9.0%]
Performing permutations : [9.2%]
Performing permutations : [9.4%]
Performing permutations : [9.6%]
Performing permutations : [9.8%]
Performing permutations : [10.0%]
Performing permutations : [10.2%]
Performing permutations : [10.4%]
Performing permutations : [10.6%]
Performing permutations : [10.8%]
Performing permutations : [11.0%]
Performing permutations : [11.2%]
Performing permutations : [11.4%]
Performing permutations : [11.6%]
Performing permutations : [11.8%]
Performing permutations : [12.0%]
Performing permutations : [12.2%]
Performing permutations : [12.4%]
Performing permutations : [12.6%]
Performing permutations : [12.8%]
Performing permutations : [13.0%]
Performing permutations : [13.2%]
Performing permutations : [13.4%]
Performing permutations : [13.6%]
Performing permutations : [13.8%]
Performing permutations : [14.0%]
Performing permutations : [14.2%]
Performing permutations : [14.4%]
Performing permutations : [14.6%]
Performing permutations : [14.8%]
Performing permutations : [15.0%]
Performing permutations : [15.2%]
Performing permutations : [15.4%]
Performing permutations : [15.6%]
Performing permutations : [15.8%]
Performing permutations : [16.0%]
Performing permutations : [16.2%]
Performing permutations : [16.4%]
Performing permutations : [16.6%]
Performing permutations : [16.8%]
Performing permutations : [17.0%]
Performing permutations : [17.2%]
Performing permutations : [17.4%]
Performing permutations : [17.6%]
Performing permutations : [17.8%]
Performing permutations : [18.0%]
Performing permutations : [18.2%]
Performing permutations : [18.4%]
Performing permutations : [18.6%]
Performing permutations : [18.8%]
Performing permutations : [19.0%]
Performing permutations : [19.2%]
Performing permutations : [19.4%]
Performing permutations : [19.6%]
Performing permutations : [19.8%]
Performing permutations : [20.0%]
Performing permutations : [20.2%]
Performing permutations : [20.4%]
Performing permutations : [20.6%]
Performing permutations : [20.8%]
Performing permutations : [21.0%]
Performing permutations : [21.2%]
Performing permutations : [21.4%]
Performing permutations : [21.6%]
Performing permutations : [21.8%]
Performing permutations : [22.0%]
Performing permutations : [22.2%]
Performing permutations : [22.4%]
Performing permutations : [22.6%]
Performing permutations : [22.8%]
Performing permutations : [23.0%]
Performing permutations : [23.2%]
Performing permutations : [23.4%]
Performing permutations : [23.6%]
Performing permutations : [23.8%]
Performing permutations : [24.0%]
Performing permutations : [24.2%]
Performing permutations : [24.4%]
Performing permutations : [24.6%]
Performing permutations : [24.8%]
Performing permutations : [25.0%]
Performing permutations : [25.2%]
Performing permutations : [25.4%]
Performing permutations : [25.6%]
Performing permutations : [25.8%]
Performing permutations : [26.0%]
Performing permutations : [26.2%]
Performing permutations : [26.4%]
Performing permutations : [26.6%]
Performing permutations : [26.8%]
Performing permutations : [27.0%]
Performing permutations : [27.2%]
Performing permutations : [27.4%]
Performing permutations : [27.6%]
Performing permutations : [27.8%]
Performing permutations : [28.0%]
Performing permutations : [28.2%]
Performing permutations : [28.4%]
Performing permutations : [28.6%]
Performing permutations : [28.8%]
Performing permutations : [29.0%]
Performing permutations : [29.2%]
Performing permutations : [29.4%]
Performing permutations : [29.6%]
Performing permutations : [29.8%]
Performing permutations : [30.0%]
Performing permutations : [30.2%]
Performing permutations : [30.4%]
Performing permutations : [30.6%]
Performing permutations : [30.8%]
Performing permutations : [31.0%]
Performing permutations : [31.2%]
Performing permutations : [31.4%]
Performing permutations : [31.6%]
Performing permutations : [31.8%]
Performing permutations : [32.0%]
Performing permutations : [32.2%]
Performing permutations : [32.4%]
Performing permutations : [32.6%]
Performing permutations : [32.8%]
Performing permutations : [33.0%]
Performing permutations : [33.2%]
Performing permutations : [33.4%]
Performing permutations : [33.6%]
Performing permutations : [33.8%]
Performing permutations : [34.0%]
Performing permutations : [34.2%]
Performing permutations : [34.4%]
Performing permutations : [34.6%]
Performing permutations : [34.8%]
Performing permutations : [35.0%]
Performing permutations : [35.2%]
Performing permutations : [35.4%]
Performing permutations : [35.6%]
Performing permutations : [35.8%]
Performing permutations : [36.0%]
Performing permutations : [36.2%]
Performing permutations : [36.4%]
Performing permutations : [36.6%]
Performing permutations : [36.8%]
Performing permutations : [37.0%]
Performing permutations : [37.2%]
Performing permutations : [37.4%]
Performing permutations : [37.6%]
Performing permutations : [37.8%]
Performing permutations : [38.0%]
Performing permutations : [38.2%]
Performing permutations : [38.4%]
Performing permutations : [38.6%]
Performing permutations : [38.8%]
Performing permutations : [39.0%]
Performing permutations : [39.2%]
Performing permutations : [39.4%]
Performing permutations : [39.6%]
Performing permutations : [39.8%]
Performing permutations : [40.0%]
Performing permutations : [40.2%]
Performing permutations : [40.4%]
Performing permutations : [40.6%]
Performing permutations : [40.8%]
Performing permutations : [41.0%]
Performing permutations : [41.2%]
Performing permutations : [41.4%]
Performing permutations : [41.6%]
Performing permutations : [41.8%]
Performing permutations : [42.0%]
Performing permutations : [42.2%]
Performing permutations : [42.4%]
Performing permutations : [42.6%]
Performing permutations : [42.8%]
Performing permutations : [43.0%]
Performing permutations : [43.2%]
Performing permutations : [43.4%]
Performing permutations : [43.6%]
Performing permutations : [43.8%]
Performing permutations : [44.0%]
Performing permutations : [44.2%]
Performing permutations : [44.4%]
Performing permutations : [44.6%]
Performing permutations : [44.8%]
Performing permutations : [45.0%]
Performing permutations : [45.2%]
Performing permutations : [45.4%]
Performing permutations : [45.6%]
Performing permutations : [45.8%]
Performing permutations : [46.0%]
Performing permutations : [46.2%]
Performing permutations : [46.4%]
Performing permutations : [46.6%]
Performing permutations : [46.8%]
Performing permutations : [47.0%]
Performing permutations : [47.2%]
Performing permutations : [47.4%]
Performing permutations : [47.6%]
Performing permutations : [47.8%]
Performing permutations : [48.0%]
Performing permutations : [48.2%]
Performing permutations : [48.4%]
Performing permutations : [48.6%]
Performing permutations : [48.8%]
Performing permutations : [49.0%]
Performing permutations : [49.2%]
Performing permutations : [49.4%]
Performing permutations : [49.6%]
Performing permutations : [49.8%]
Performing permutations : [50.0%]
Performing permutations : [50.2%]
Performing permutations : [50.4%]
Performing permutations : [50.6%]
Performing permutations : [50.8%]
Performing permutations : [51.0%]
Performing permutations : [51.2%]
Performing permutations : [51.4%]
Performing permutations : [51.6%]
Performing permutations : [51.8%]
Performing permutations : [52.0%]
Performing permutations : [52.2%]
Performing permutations : [52.4%]
Performing permutations : [52.6%]
Performing permutations : [52.8%]
Performing permutations : [53.0%]
Performing permutations : [53.2%]
Performing permutations : [53.4%]
Performing permutations : [53.6%]
Performing permutations : [53.8%]
Performing permutations : [54.0%]
Performing permutations : [54.2%]
Performing permutations : [54.4%]
Performing permutations : [54.6%]
Performing permutations : [54.8%]
Performing permutations : [55.0%]
Performing permutations : [55.2%]
Performing permutations : [55.4%]
Performing permutations : [55.6%]
Performing permutations : [55.8%]
Performing permutations : [56.0%]
Performing permutations : [56.2%]
Performing permutations : [56.4%]
Performing permutations : [56.6%]
Performing permutations : [56.8%]
Performing permutations : [57.0%]
Performing permutations : [57.2%]
Performing permutations : [57.4%]
Performing permutations : [57.6%]
Performing permutations : [57.8%]
Performing permutations : [58.0%]
Performing permutations : [58.2%]
Performing permutations : [58.4%]
Performing permutations : [58.6%]
Performing permutations : [58.8%]
Performing permutations : [59.0%]
Performing permutations : [59.2%]
Performing permutations : [59.4%]
Performing permutations : [59.6%]
Performing permutations : [59.8%]
Performing permutations : [60.0%]
Performing permutations : [60.2%]
Performing permutations : [60.4%]
Performing permutations : [60.6%]
Performing permutations : [60.8%]
Performing permutations : [61.0%]
Performing permutations : [61.2%]
Performing permutations : [61.4%]
Performing permutations : [61.6%]
Performing permutations : [61.8%]
Performing permutations : [62.0%]
Performing permutations : [62.2%]
Performing permutations : [62.4%]
Performing permutations : [62.6%]
Performing permutations : [62.8%]
Performing permutations : [63.0%]
Performing permutations : [63.2%]
Performing permutations : [63.4%]
Performing permutations : [63.6%]
Performing permutations : [63.8%]
Performing permutations : [64.0%]
Performing permutations : [64.2%]
Performing permutations : [64.4%]
Performing permutations : [64.6%]
Performing permutations : [64.8%]
Performing permutations : [65.0%]
Performing permutations : [65.2%]
Performing permutations : [65.4%]
Performing permutations : [65.6%]
Performing permutations : [65.8%]
Performing permutations : [66.0%]
Performing permutations : [66.2%]
Performing permutations : [66.4%]
Performing permutations : [66.6%]
Performing permutations : [66.8%]
Performing permutations : [67.0%]
Performing permutations : [67.2%]
Performing permutations : [67.4%]
Performing permutations : [67.6%]
Performing permutations : [67.8%]
Performing permutations : [68.0%]
Performing permutations : [68.2%]
Performing permutations : [68.4%]
Performing permutations : [68.6%]
Performing permutations : [68.8%]
Performing permutations : [69.0%]
Performing permutations : [69.2%]
Performing permutations : [69.4%]
Performing permutations : [69.6%]
Performing permutations : [69.8%]
Performing permutations : [70.0%]
Performing permutations : [70.2%]
Performing permutations : [70.4%]
Performing permutations : [70.6%]
Performing permutations : [70.8%]
Performing permutations : [71.0%]
Performing permutations : [71.2%]
Performing permutations : [71.4%]
Performing permutations : [71.6%]
Performing permutations : [71.8%]
Performing permutations : [72.0%]
Performing permutations : [72.2%]
Performing permutations : [72.4%]
Performing permutations : [72.6%]
Performing permutations : [72.8%]
Performing permutations : [73.0%]
Performing permutations : [73.2%]
Performing permutations : [73.4%]
Performing permutations : [73.6%]
Performing permutations : [73.8%]
Performing permutations : [74.0%]
Performing permutations : [74.2%]
Performing permutations : [74.4%]
Performing permutations : [74.6%]
Performing permutations : [74.8%]
Performing permutations : [75.0%]
Performing permutations : [75.2%]
Performing permutations : [75.4%]
Performing permutations : [75.6%]
Performing permutations : [75.8%]
Performing permutations : [76.0%]
Performing permutations : [76.2%]
Performing permutations : [76.4%]
Performing permutations : [76.6%]
Performing permutations : [76.8%]
Performing permutations : [77.0%]
Performing permutations : [77.2%]
Performing permutations : [77.4%]
Performing permutations : [77.6%]
Performing permutations : [77.8%]
Performing permutations : [78.0%]
Performing permutations : [78.2%]
Performing permutations : [78.4%]
Performing permutations : [78.6%]
Performing permutations : [78.8%]
Performing permutations : [79.0%]
Performing permutations : [79.2%]
Performing permutations : [79.4%]
Performing permutations : [79.6%]
Performing permutations : [79.8%]
Performing permutations : [80.0%]
Performing permutations : [80.2%]
Performing permutations : [80.4%]
Performing permutations : [80.6%]
Performing permutations : [80.8%]
Performing permutations : [81.0%]
Performing permutations : [81.2%]
Performing permutations : [81.4%]
Performing permutations : [81.6%]
Performing permutations : [81.8%]
Performing permutations : [82.0%]
Performing permutations : [82.2%]
Performing permutations : [82.4%]
Performing permutations : [82.6%]
Performing permutations : [82.8%]
Performing permutations : [83.0%]
Performing permutations : [83.2%]
Performing permutations : [83.4%]
Performing permutations : [83.6%]
Performing permutations : [83.8%]
Performing permutations : [84.0%]
Performing permutations : [84.2%]
Performing permutations : [84.4%]
Performing permutations : [84.6%]
Performing permutations : [84.8%]
Performing permutations : [85.0%]
Performing permutations : [85.2%]
Performing permutations : [85.4%]
Performing permutations : [85.6%]
Performing permutations : [85.8%]
Performing permutations : [86.0%]
Performing permutations : [86.2%]
Performing permutations : [86.4%]
Performing permutations : [86.6%]
Performing permutations : [86.8%]
Performing permutations : [87.0%]
Performing permutations : [87.2%]
Performing permutations : [87.4%]
Performing permutations : [87.6%]
Performing permutations : [87.8%]
Performing permutations : [88.0%]
Performing permutations : [88.2%]
Performing permutations : [88.4%]
Performing permutations : [88.6%]
Performing permutations : [88.8%]
Performing permutations : [89.0%]
Performing permutations : [89.2%]
Performing permutations : [89.4%]
Performing permutations : [89.6%]
Performing permutations : [89.8%]
Performing permutations : [90.0%]
Performing permutations : [90.2%]
Performing permutations : [90.4%]
Performing permutations : [90.6%]
Performing permutations : [90.8%]
Performing permutations : [91.0%]
Performing permutations : [91.2%]
Performing permutations : [91.4%]
Performing permutations : [91.6%]
Performing permutations : [91.8%]
Performing permutations : [92.0%]
Performing permutations : [92.2%]
Performing permutations : [92.4%]
Performing permutations : [92.6%]
Performing permutations : [92.8%]
Performing permutations : [93.0%]
Performing permutations : [93.2%]
Performing permutations : [93.4%]
Performing permutations : [93.6%]
Performing permutations : [93.8%]
Performing permutations : [94.0%]
Performing permutations : [94.2%]
Performing permutations : [94.4%]
Performing permutations : [94.6%]
Performing permutations : [94.8%]
Performing permutations : [95.0%]
Performing permutations : [95.2%]
Performing permutations : [95.4%]
Performing permutations : [95.6%]
Performing permutations : [95.8%]
Performing permutations : [96.0%]
Performing permutations : [96.2%]
Performing permutations : [96.4%]
Performing permutations : [96.6%]
Performing permutations : [96.8%]
Performing permutations : [97.0%]
Performing permutations : [97.2%]
Performing permutations : [97.4%]
Performing permutations : [97.6%]
Performing permutations : [97.8%]
Performing permutations : [98.0%]
Performing permutations : [98.2%]
Performing permutations : [98.4%]
Performing permutations : [98.6%]
Performing permutations : [98.8%]
Performing permutations : [99.0%]
Performing permutations : [99.2%]
Performing permutations : [99.4%]
Performing permutations : [99.6%]
Performing permutations : [99.8%]
p-value: 0.002

Total running time of the script: ( 1 minutes 41.706 seconds)

Gallery generated by Sphinx-Gallery