[FieldTrip] PLV, wPLI: Discripancy using powandcsd and fourier

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Mon Aug 3 10:28:27 CEST 2020


Hi Akshay,

I understand your question, but honestly the pasted code is not sufficient for me to try and reproduce. Nonetheless, a few things can be said:

PLV is a measure (as is wPLI) that requires single trial spectrally resolved data as an input. This is because the algorithmic steps that are needed to compute the connectivity measure include a per-trial normalisation of the fourier coefficients by their magnitude (plv), or some other fancy non-linear manipulation of the single trial phase difference estimates (wPLI). If you ask ft_freqanalysis to output ‘powandcsd’, without explicitly specifying cfg.keeptrials = ‘yes’, then the single trial dimension is lost for posterity, and the consequent computation of the PLV/wPLI is nonsense (unless you used as an input a single epoch’s spectrally transformed data with massive multitapering, keeping the information of the individual tapers, but that’s a different story altogether). In other words, where you mention that you think that ‘fourier’ is the right way to implement these, you are right, but as an alternative you could have used ‘powandcsd’ + ‘keeptrials = ‘yes’’.

The NaNs versus 1 are easily explained by the fact that with ‘powandcsd’ the diagonal elements are explicitly set to NaN (i.e. they are not computed), whereas in the ‘fourier’ case they are, and they trivially result in an all(ones).

Best wishes,
Jan-Mathijs


On 2 Aug 2020, at 23:35, Akshay Ravindran <akshay.s.ravindran at gmail.com<mailto:akshay.s.ravindran at gmail.com>> wrote:

Good Evening,

I tried estimating the functional connectivity using different phase-based measures like PLV and wPLI_debiased. I tried testing the two measures using cfg.output set to either 'fourier' or 'powandcsd' as I have seen people implementing PLV with both. However, I am getting quite varying results using either of these on an EEG data saved in .set file loaded and run using the commands shown at the end of this question.

Even though I think 'fourier' is the right way to implement these, to test for the validity of it, I tested this on the artificial data created using the ft_connectivitysimulation function ( 3 channel, 200 Hz Fs, the same number of trials as EEG, default noise covariance and params as in the example). In this case however, I am getting the very same results using either output (off-diagonal elements are the same in either; diagonal elements are NAN in using powandcsd whereas 1 while using Fourier).

My question is mainly the following
1) Am I missing something while testing on EEG data? If not,  why is there a discrepancy found while testing on EEG but not on the simulated data?
2) Is there any recommended instance of using 'powandcsd ' over 'fourier'  in any of the connectivity measures?


% EEG sampled at 200 Hz, 60 channels with events. The epoching is fine as the ERP was validated after epoching.
data              = ft_connectivitysimulation(cfg);
cfg = [];
cfg.channel = ['all'];
cfg.dataset                 = 'Dataset_Epochs.set';
cfg.trialfun                = 'ft_trialfun_general'; % this is the default
cfg.trialdef.eventtype      = 'trigger';
cfg.trialdef.eventvalue     = 'Onset';
cfg.trialdef.prestim        = 0.2; % in seconds
cfg.trialdef.poststim       = 0.6; % in seconds
cfg = ft_definetrial(cfg);
data= ft_preprocessing(cfg);


cfg           = [];
cfg.pad       = 'nextpow2';
cfg.method    = 'mtmfft';
cfg.taper     = 'hanning';
cfg.output    = 'fourier';; % Tried replacing this with powandcsd and both yielded different results
cfg.keeptrials  = 'yes'
cfg.tapsmofrq = 1;
spectral_decomp          = ft_freqanalysis(cfg, data);
% Compute the functional connectivity using PLV
cfg            = [];
cfg.method    = 'plv'
fc  = ft_connectivityanalysis(cfg, spectral_decomp);


To further test if it is something with the particular dataset, I also tried on separate continuous EEG data  which was segmented in fieldtrip. However this yielded similar quite varying results when using either output
 % cfg.dataset                 = 'Dataset_RS.set';
 % [data] = ft_preprocessing(cfg)
%cfg = [];
%cfg.length  = 6;
%cfg.overlap = 0;
%data_segmented = ft_redefinetrial(cfg, data);

 Thanks,

--
Regards,

ASR


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200803/c2aa6748/attachment.htm>


More information about the fieldtrip mailing list