Difference between wPLI from FieldTrip and MNE - Python

Hello,

I am currently working with the calculation of wPLI on EEG data and I saw that the MNE implementation of the wPLI is a little bit different by the one from MATLAB FieldTrip package. It seems that MNE uses the equation 8 from Vinck et al., 2011, while the FieldTrip uses the same formula, but without the abs() operator on the numerator.

I am calculating the values using MNE - Python, while a colleague is using FieldTrip, and our results are quite different. Does someone know if the different formulation can cause different results for the same set of patients?

Hello @igor-casatti and welcome to the forum!

I’m not familiar at all with wLPI – maybe @agramfort has an idea…?

Best wishes,
Richard

Hi

Can you point to the lines in mne and fieldtrip source codes that are different? I would also add Robert Oostenveld about this. He is likely to be the one who wrote the WPLI code in fieldtrip.

Alex

Hi,

In the line 119 of the FieldTrip script:

And in the lines 428 - 451 of the MNE code:

Thanks for the reply.

Igor

Hello Igor, I took the liberty to slightly edit your posting such that the relevant bits of code would show up in the forum directly.

1 Like

hi @igor-casatti

I just looked at the code. The two implementation are doing the same except that MNE applies an abs at the end following es (8). It’s true that one could argue that it’s still possible to compute the abs afterwards but the paper has it. So in fieldtrip just compute the abs manually and the results should match.

Alex

1 Like