Back to the main page.
Bug 3234 - Bug in ft_crossfrequencyanalysis
Status | CLOSED FIXED |
Reported | 2017-01-19 12:18:00 +0100 |
Modified | 2019-08-10 12:41:03 +0200 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Windows |
Importance: | P5 normal |
Assigned to: | Robert Oostenveld |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Stephen Whitmarsh - 2017-01-19 12:18:16 +0100
Hi there, [Sorry, I could have done the following myself but my github installation on Windows 10 at work remains broken after several attempts] I looked at the code for the modulation index in ft_crossfrequencyanalysis. The code has one mistake/typo. Line 186 says: mi(i,j) = nansum(P.* (log2(P)-log2(Q)))/log2(pha); The last variable 'pha' has to be 'nbin' instead. It also uses log2 instead of log, which does not make a difference in the results, but for the sake of consistency with the original paper (below) it might be good to replace log2 with log (only line 186). The calculation is made in some separate steps, and since the log calculations are not so transparent for me I tested the results with the results of the calculation based on the code of the original author (personal correspondence, via-via), and the results are identical. Just a good check. The following paper can be cited as the original idea and calculation of the MI for neurophysiological data: Tort A. B. L., Komorowski R., Eichenbaum H., Kopell N. (2010). Measuring Phase-Amplitude Coupling Between Neuronal Oscillations of Different Frequencies. J Neurophysiol 104: 1195–1210. doi:10.1152/jn.00106.2010
Robert Oostenveld - 2017-01-19 14:41:45 +0100
I have implemented the changes as suggested and added the following to the help of the function. % Various metrics for cross-frequency coupling have been introduced in a number of % scientific publications, but these do not use a sonsistent method naming scheme, % nor implement it in exactly the same way. The particular implementation in this % code tries to follow the most common format, generalizing where possible. If you % want details about the algorithms, please look into the code. % % The modulation index implements % Tort A. B. L., Komorowski R., Eichenbaum H., Kopell N. (2010). Measuring Phase-Amplitude % Coupling Between Neuronal Oscillations of Different Frequencies. J Neurophysiol 104: % 1195–1210. doi:10.1152/jn.00106.2010 mac011> git commit -a [master 3ab5679] FIX - see http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3234 1 file changed, 12 insertions(+), 9 deletions(-) mac011> git push upstream master X11 forwarding request failed on channel 0 You're about to push master, is that what you intended? [y|n] y Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 826 bytes | 0 bytes/s, done. Total 3 (delta 2), reused 0 (delta 0) remote: Resolving deltas: 100% (2/2), completed with 2 local objects. To github.com:fieldtrip/fieldtrip.git a33f575..3ab5679 master -> master
Robert Oostenveld - 2019-08-10 12:34:52 +0200
This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue on https://github.com/fieldtrip/fieldtrip/issues.