- MNE version: 1.8.0
- operating system:Windows 10
Hi All,
I am trying to run permutation cluster stats on my phase-amplitude coupling (PAC) data and having some issues with implementation.
My data structure:
pac_all - numpy array of shape (24, 60, 20, 20) (participants x electrodes x phase_frequency x amplitude_frequency)
I don’t have epochs dimension, since the PAC values vere computed on concatenated epochs for each participant.
There is no contrast between conditions so far, I want to know the significant PAC values for each electrode separately.
Here’s my code:
# Compute adjacency matrix
sensor_adjacency, ch_names = mne.channels.find_ch_adjacency(epochs.info, "eeg")
adjacency = mne.stats.combine_adjacency(
sensor_adjacency, pac_all.shape[2], pac_all.shape[3]
)
sensor_adjacency.shape = (60, 60)
adjacency.shape = (24000, 24000)
# We want a one-tailed test, since PAC values are positive numbers
tail = 1
t_thresh = scipy.stats.t.ppf(1 - 0.01, df=degrees_of_freedom) # np.float64(2.4998667394943976)
# Set the number of permutations to run
n_permutations = 1000
# Run the analysis
T_obs, clusters, cluster_p_values, H0 = permutation_cluster_1samp_test(
pac_all,
n_permutations=n_permutations,
threshold=12,
tail=tail,
adjacency=adjacency,
out_type="mask",
max_step=1,
verbose=True,
)
T_obs.mean() = np.float64(8.314733192984257)
len(clusters) = 1
cluster_p_values = array([0.001])
Why do I only get one cluster?
Even if I increase the threshold to 8 and get 9 clusters, all the cluster_p_values are equal to 0.001, which does not seem right.
How can I visualise the output for each electrode to see what is going on?
(to see significant PAC values in colour and all the rest - in black and white)
Am I passing the right structure to the test at all?
I am using the tutorial for TF stats analysis as a reference, where the structure of the data is (n_obs x electrodes x phase_frequency x amplitude_frequency)