Closed mschart closed 7 months ago
Hi @mschart!
While magnitude squared coherence is symmetric, the averaging across trials happens over the complex-valued coherency, which isn't symmetric -- coh(X,Y)=coh(Y,X) [where is complex conjugate). So if the two signals are sometimes swapped for different trials, it will change the trial average.
Does that make sense?
Fantastic, glad to read that, thanks a lot!
Hi there,
Thanks a lot for providing this superb toolbox! We are analyzing ephys data with it and wondered about the symmetry of coherence when probing it via shuffling the input data.
Let's say our signal with trial structure is of shape 2 channels x 500 trials x 800 observations. Now computing coherence gives this on top row. Now when taking the same data but swapping randomly the channel order, independently for each trial, we find the same shape of the frequency-dependent coherence, however the magnitude decreased substantially.
Given that coherence should be a symmetric measure, we wonder if something in the trial averaging could have caused that amplitude drop.
For spectral granger - an asymmetric measure - also the shape of the result changed, as expected:
If you have any thoughts as of why that amplitude dropped for the shuffled data we'd be glad to hear them!
Many thanks!