Back to the main page.

Bug 2477 - ft_connectivity_psi gives incorrect output

Status CLOSED FIXED
Reported 2014-02-18 19:44:00 +0100
Modified 2014-03-06 15:35:55 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: All
Operating System: All
Importance: P5 normal
Assigned to: Jan-Mathijs Schoffelen
URL:
Tags:
Depends on:
Blocks:
See also:

Björn Herrmann - 2014-02-18 19:44:35 +0100

Hey fieldtrip team, I believe I found a bug in ft_connectivity_psi.m. The output variable p seems to be an intermediate step in the calculation of the connectivity measure (variable c). Thus, the connectivity output as far as I can tell (without understanding all of the code) should be incorrect. Best, Björn


Jan-Mathijs Schoffelen - 2014-02-18 20:27:13 +0100

Hi Björn, As far as I can tell the implementation is correct. The variable called 'c' is the cross-spectral density matrix. In line 92, the c is normalized with sqrt(p1.*p2) yielding the complex-valued coherency. This serves as an input to the phaseslope function that is implemented in exactly the same way as described by Guido Nolte. Please let me know if you disagree. JM


Jan-Mathijs Schoffelen - 2014-02-20 15:38:12 +0100

Hi Bjorn, do you still have objections against the code?


Jan-Mathijs Schoffelen - 2014-02-21 07:40:48 +0100

Indeed the code was incorrect. However the mix-up in variables has so far been probably inconsequential, because the code will be called with a single 'repetition' (i.e. the average across trials) by default from ft_connectivityanalysis.


Jan-Mathijs Schoffelen - 2014-02-21 07:41:46 +0100

svn commit -m "bugfix - assign correct output, in case of multiple repetitions" ft_connectivity_psi.m Sending ft_connectivity_psi.m Transmitting file data . Committed revision 9212.