Analysis of connectivity

Introduction

In this tutorial we will explore different measures of connectivity, while working with simulated data. You will learn how to compute various connectivity measures from these data. Since this tutorial focusses on connectivity measures in the frequency domain, we expect that you understand the basics of frequency domain analysis, because this is not covered by this tutorial. Also, this tutorial does not cover the pitfalls associated with the analysis of connectivity and the interpretational difficulties of the results.

Background

Connectivity between brain regions/neuronal groups is crucial for cognition and behavior. Many measures of connectivity exist, and they can be broadly divided into measures of functional connectivity (denoting statistical dependencies between measured signals, without information about causality/directionality), and measures of effective connectivity, which describe directional interactions.

Procedure

To explore the different measures of connectivity we will perform the following steps:

Data simulation

We will first simulate some data with a known connectivity structure built in. This way we know what to expect in terms of connectivity. To simulate data we use ft_connectivitysimulation. We will use an order 2 multivariate autoregressive model. The necessary ingredients are a set of NxN coefficient matrices, one matrix for each time lag. These coefficients need to be stored in the cfg.param field. Next to the coefficients we have to specify the NxN covariance matrix of the innovation noise. This matrix needs to be stored in the cfg.noisecov field.

cfg             = [];
cfg.ntrials     = 500;
cfg.triallength = 1;
cfg.fsample     = 200;
cfg.nsignal     = 3;
cfg.method      = 'ar';

cfg.params(:,:,1) = [ 0.8    0    0 ; 
                        0  0.9  0.5 ;
                      0.4    0  0.5];
                      
cfg.params(:,:,2) = [-0.5    0    0 ; 
                        0 -0.8    0 ; 
                        0    0 -0.2];
                        
cfg.noisecov      = [ 0.3    0    0 ;
                        0    1    0 ;
                        0    0  0.2];

data              = ft_connectivitysimulation(cfg);

Computation of the multivariate autoregressive model

In order to be able to compute spectrally resolved granger causality, or other frequency domain directional measures of connectivity, we have to fit an autoregressive model to the data. This is done by ft_mvaranalysis. The actual computation of the autoregressive coefficients is not done by FieldTrip code, but relies on external code from third party toolboxes. At present ft_mvaranalysis supports the biosig and bsmart toolboxes for the computation of the coefficients. In order to be able to use this functionality, you have to install a copy of one of the toolboxes on your own Matlab-path. In this tutorial we will use the bsmart-toolbox. It is available for download here.

cfg         = [];
cfg.order   = 5;
cfg.toolbox = 'bsmart';
mdata       = ft_mvaranalysis(cfg, data);

mdata = 

         dimord: 'chan_chan_lag'
          label: {3x1 cell}
         coeffs: [3x3x5 double]
       noisecov: [3x3 double]
            dof: 500
    fsampleorig: 200
            cfg: [1x1 struct]
            

The variable mdata contains a description of the data in terms of a multivariate autoregressive model. For each time-lag up to the model order (of 5 in this case), a 3×3 matrix of coefficients is outputted. The noisecov-field contains covariance matrix of the model's residuals.

Exercise 1

Compare the parameters specified for the simulation with the estimated coefficients and discuss.

Computation of the spectral transfer function

From the autoregressive coefficients it is now possible to compute the spectral transfer matrix, for which we use ft_freqanalysis.

cfg        = [];
cfg.method = 'mvar';
mfreq      = ft_freqanalysis(cfg, mdata);
 
mfreq = 
 
        label: {3x1 cell}
         freq: [1x101 double]
       dimord: 'chan_chan_freq'
     transfer: [3x3x101 double]
     noisecov: [3x3 double]
    crsspctrm: [3x3x101 double]
          dof: 500
          cfg: [1x1 struct]
 

It is also possible to compute the spectral transfer function using non-parametric spectral factorization of the cross-spectral density matrix. For this, we need a fourier decomposition of the data. This is done in the following section.

Non-parametric computation of the cross-spectral density matrix

Some connectivity metrics can be computed from a non-parametric spectral estimate (i.e. after the application of the FFT-algorithm and conjugate multiplication to get cross-spectral densities), such as coherence, phase-locking value and phase slope index. The following part computes the fourier-representation of the data using ft_freqanalysis. It is not necessary to compute the cross-spectral density at this stage, because the function used in the next step, ft_connectivityanalysis, contains functionality to compute the cross-spectral density from the fourier coefficients.

cfg           = [];
cfg.method    = 'mtmfft';
cfg.output    = 'fourier';
cfg.tapsmofrq = 2;
freq          = ft_freqanalysis(cfg, data);

freq = 

            label: {3x1 cell}
           dimord: 'rpttap_chan_freq'
             freq: [1x101 double]
    fourierspctrm: [1500x3x101 double]
        cumsumcnt: [500x1 double]
        cumtapcnt: [500x1 double]
              cfg: [1x1 struct]

Computation and inspection of the connectivity measures

The actual computation of the connectivity metric is done by ft_connectivityanalysis. This function is transparent to the type of input data, i.e. provided the input data allows the requested metric to be computed, the metric will be calculated. Here, we provide an example for the computation and visualization of the coherence coefficient.

cfg           = [];
cfg.method    = 'coh';
coh           = ft_connectivityanalysis(cfg, freq);
cohm          = ft_connectivityanalysis(cfg, mfreq);

Subsequently, the data can be visualized using ft_connectivityplot.

cfg           = [];
cfg.parameter = 'cohspctrm';
ft_connectivityplot(cfg, coh, cohm);

The coherence measure is a symmetric measure, which means that it does not provide information regarding the direction of information flow between any pair of signals. In order to analyze directionality in interactions, measures based on the concept of granger causality can be computed. These measures are based on an estimate of the spectral transfer matrix, which can be computed in a straightforward way from the multivariate autoregressive model fitted to the data.

cfg           = [];
cfg.method    = 'granger';
granger       = ft_connectivityanalysis(cfg, mfreq);

cfg           = [];
cfg.parameter = 'grangerspctrm';
ft_connectivityplot(cfg, granger);

Exercise 2

Discuss the differences between the granger causality spectra, and the coherence spectra.

Exercise 3

Compute the following connectivity measures from the data (mfreq), and visualize and discuss the results: partial directed coherence (pdc), directed transfer function (dtf), phase slope index (psi)

This tutorial was last tested by Jan-Mathijs with revision 4372 of FieldTrip (~20111007) on a 64-bit linux machine using Matlab 2009b.

tutorial/connectivity.txt · Last modified: 2011/11/02 14:41 by lilla

You are here: starttutorialconnectivity
This DokuWiki features an Anymorphic Webdesign theme, customised by Eelke Spaak and Stephen Whitmarsh.
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0