[FieldTrip] granger causality

jan-mathijs schoffelen jan.schoffelen at donders.ru.nl
Thu Aug 2 09:16:26 CEST 2012

Hi Carina,

> 1.) I know that I can calculate the appropriate model order and window length with the bsmart toolbox. But from the documentation I somehow do not get the format of data I should use for this calculation. 
> When I enter the time-frequency data (which I want to use to estimate granger causality) (size: 2 x 2 x freq x time points), it doesn't work.

The 'it doesn't work' statement is typically not enough for us to diagnose where the problem lies (at least at which step it goes wrong). At the moment I can only assume that you use an outdated version of FieldTrip, because when I try to do TF-resolved Granger using AR-models it works. It is good that you pasted the script below, but an error message may be informative too.

> Any advise? I have a sampling rate of 1000. What sort of time window and maximal model order would make sense do you think?

I think that the time window is rather short: I'd rather go for 0.4 or 0.5 to begin with, but this is an empirical question. Also, shifting the windows one time step at a time does not really make sense to me, 0.01 or even 0.05 is much more memory friendly. For the model order: higher one. Some people seem to get nice results when taking a relatively high model order. Of course, for a high model order you also need longer time-windows.

> 2)I would like to keep the time domain analyzing my data. What do you think would be an appropriate sliding time window using the 'ft_mvaranalysis' function? And what does it mean exactly? By choosing the model order, I am already determining the maximal time lag between the two functions. Are the values then estimated for the whole time window?

No. The time window determines the length of the data segment which is used to fit an AR-model (of order X) of the data at time point Y (as defined in your toi)

> 3)What do you think about statistics? Would it makes sense to use the non-parametric cluster approach to shuffle within patients and do a group analysis that way?

This depends on your experimental question and you null-hypothesis.


> Thank you so much in advance!
> Best,
> Carina
> As a summary,I am doing following steps with field trip:
> cfg = [];
> cfg.dftfilter ='yes'
> prep_cond1{subj} = ft_preprocessing(cfg, data);
> cfg         = [];
> cfg.order   = 5;
> cfg.toolbox = 'bsmart';
> cfg.t_ftimwin = 0.05
> cfg.toi       = -1:0.001:3.5;
> mdata_cond1{subj}= ft_mvaranalysis(cfg, prep_cond1{subj});
> cfg = [];
> cfg.method = 'mvar';
> cfg.foi        = 4:100;
> cond1_freq{subj}=  ft_freqanalysis_mvar(cfg,mdata_cond1{subj});
> cfg           = [];
> cfg.method    = 'granger';
> cond1_granger{subj}  = ft_connectivityanalysis(cfg, cond1_freq{subj});
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

Jan-Mathijs Schoffelen, MD PhD 

Donders Institute for Brain, Cognition and Behaviour, 
Centre for Cognitive Neuroimaging,
Radboud University Nijmegen, The Netherlands

Max Planck Institute for Psycholinguistics,
Nijmegen, The Netherlands

J.Schoffelen at donders.ru.nl
Telephone: +31-24-3614793

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120802/8103eba7/attachment-0001.html>

More information about the fieldtrip mailing list