[FieldTrip] Granger causality - parametric and non-parametric calculation

Hähnke, Daniel daniel.haehnke at tum.de
Thu Oct 29 18:25:31 CET 2015

Thank you Jan-Mathijs for your opinion and suggestions! Thanks, Alik for the paper, this looks interesting.

Now that I applied non-parametrically calculated Granger-causality for my data, I have to follow-up questions:

1. During the computation of spectral factorisation, the implementation of Wilson’s algorithm complains that “when performing non-parametric spectral factorisation the frequency axis should ideally be zero-padded”. I guess this means that the frequency axis should start at 0. However, as far as I can see that’s not possible using ft_freqanalysis. The code then goes on and performs the zero-padding. I don’t really understand why exactly it does the padding the way it does: it seems to add other frequencies as well, so that the frequency axis the algorithm is actually working with starts with 0 and is followed by some frequencies that are even higher than the first frequency from the original axis, before the original axis is starts.

So my questions are: Should I be concerned about this warning? Why is the zero-padding of the frequency axis so weird?

2. I found that when I apply the GC computation to my data there seems to be some kind of edge artefact at the highest frequencies when I average across combinations that represent the same anatomical direction (see attached plot).
Why do I get this effect and is it related to my first question?



On 29 Oct 2015, at 10:42, Alik Widge <alik.widge at gmail.com<mailto:alik.widge at gmail.com>> wrote:

You may also find this informative:

Disclaimer: I have not personally tried this yet, although it's on our list for a near future.

Alik Widge
alik.widge at gmail.com<mailto:alik.widge at gmail.com>
(206) 866-5435

On Thu, Oct 29, 2015 at 2:49 AM, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:
Hi Daniel

> I am currently computing the Granger causality between LFP signals from different brain regions. As it turns out, this is a more challenging endeavour than I had previously thought.

Has anyone said to you it would not be challenging ;o)?

> While testing parametric and non-parametric approaches to computing Granger causality, I came across some behaviour which seems odd to me. I hope someone can shed light on these issues:
> 1. Using the parametric approach (ft_mvaranalysis -> ft_freqanalysis -> ft_connectivityanalysis) I found that ft_freqanalysis can’t deal with MVAR data that contains a trial dimension. The first error is actually that it can’t find the field ‘label’, and this is true: if you run ft_mvaranalysis with cfg.keeptrials = ‘yes’, the resulting structure lacks the ‘label’ field. However, if I manually copy the ‘label’ field from the original data to the MVAR data, ft_freqanalysis stops at some point where it uses an array that lacks one dimension.

OK, this could (or could not) be a general issue with the code. The part of FieldTrip that deals with AR-modelling is quite old, and it could be that more recent changes in other parts of the code (e.g. concerning with data bookkeeping) destroyed some of the functionality. None of the developers are actively using AR-models in their daily research nowadays, so it could be that this code is a bit stale. This being said, in general I don’t think it is a good idea to fit an AR-model to a single trial worth of data. This would probably lead to not so meaningful estimates. It would be more meaningful to use a jackknife approach, where a variance across trials (or some measure that quantifies the extent to which a single trial differs from the rest) can be obtained with a leave-one-out approach.

> 2. Using the non-parametric approach (ft_freqanalysis -> ft_connectivityanalysis) I stumbled across the problem that the implementation of Wilson’s algorithm that computes the factorisation of the spectral density matrix doesn’t allow non-integer frequencies nor non-equal distances between frequencies. Is this an inherent limitation of this algorithm?


> 3. Again for the non-parametric approach: If I use trial-resolved FREQ data for ft_connectivityanalysis, the trial dimension is lost at line 389 if I use data contain a ‘fourierspctrm’ field. If I use data containing a ‘powspctrm’ field, it takes literally hours at line 392 to ‘fix’ the CSD at line 585 in ft_checkdata (which uses ‘fixcsd’) for every trial. This is not resolved by using FREQ data which has both a ‘powspctrm’ as well as a ‘crsspctrm’ field.

The input into ft_connectivityanalysis should be a frequency domain data structure containing either a ‘fourierspctrm’ (obtained with cfg.output=‘fourier’), or a crsspctrm/powspctrm (obtained with cfg.output=‘powandcsd’). Specifying cfg.output=‘pow’ does not make sense. I would expect it to crash, if it doesn’t we should consider making the error handling more strict. Also, for Wilson’s algorithm, the estimate of the cross-spectral density needs to be somewhat robust, and a single trial estimate in my opinion does not really make sense. The step at which the fourierspctrm representation is converted into the cross-spectrum ‘knows’ this, and kicks out the trial dimension. The ‘fixcsd’ step in ft_checkdata can in deed be notoriously slow in some cases, which can be prevented to start from the right format of the data to begin with (as per ft_freqanalysis).

> I’m not really sure whether I need trial-resolved Granger-causality, but in theory this should be possible. Of course, I could work around this issue by just using 1-trial FREQ data for ft_connectivityanalysis.

Please do.


> Thanks in advance for your ideas!
> All the best,
> Daniel
> --
> Daniel Hähnke
> PhD student
> Technische Universität München
> Institute of Neuroscience
> Translational NeuroCognition Laboratory
> Biedersteiner Straße 29, Bau 601
> 80802 Munich
> Germany
> Email: daniel.haehnke at tum.de<mailto:daniel.haehnke at tum.de>
> Phone: +49 89 4140 3356<tel:%2B49%2089%204140%203356>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>

fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151029/e46d2838/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: granger.PNG
Type: image/png
Size: 82768 bytes
Desc: granger.PNG
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151029/e46d2838/attachment-0002.png>

More information about the fieldtrip mailing list