[FieldTrip] Query Regarding Granger Causality Calculation in FieldTrip Toolbox

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Mon Oct 23 08:54:28 CEST 2023


Hi Yeganeh,

Consulting the help section of ft_connectivityanalysis, line 29 states:

%     'granger',   granger causality, support for freq and freqmvar data

This means that there is currently no support for source-level data to compute granger causality using only fieldtrip function calls. This is in line with the error message you receive.

Best wishes,
Jan-Mathijs





> On 20 Oct 2023, at 19:31, Yegane Modaresnia via fieldtrip <fieldtrip at science.ru.nl> wrote:
>
> Dear Fieldtrip team,
>
> I hope this message finds you well. I am currently working on calculating the effective connectivity between sources using Granger causality in the FieldTrip toolbox. I have been using the following code:
>
> cfg         = [];
> cfg.method  ='granger';
> % cfg.complex = 'absimag';
> source_conn = ft_connectivityanalysis(cfg, source);
> figure(9);imagesc(source_conn.cohspctrm);
>
> However, I have encountered an error message:
> "This function requires 'mvar', 'freqmvar' or 'freq' data as input, see ft_datatype_mvar or ft_datatype_freq."
>
> Upon inspecting the ft_connectivityanalysis function, I noticed that it accepts either two inputs in the form of (cfg, source) or (cfg, freq). My confusion lies in understanding how to define 'freq' before applying this Granger causality code, and how this relates to the 'source' data.
>
> Could you kindly provide some guidance or insights on how to properly handle the frequency data in conjunction with the source data for this granger connectivity analysis?
>
> Thank you very much for your assistance.
>
> Warm regards,
> Yeganeh
> _______________________________________________
> fieldtrip mailing list
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C01%7Cfieldtrip%40science.ru.nl%7C41e5b11f0dad40f7dad208dbd394e714%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638336408714788862%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=EoERiWT4jhHnfF4SnUcPz7hLIjvH3e6SvPumwFy6lno%3D&reserved=0
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C01%7Cfieldtrip%40science.ru.nl%7C41e5b11f0dad40f7dad208dbd394e714%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638336408714788862%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ZspLIysE9HgS%2F47lnHLkD9cTS30Kavd%2BhUaUuM7fVSk%3D&reserved=0




More information about the fieldtrip mailing list