We developed a numerical code, named FunCAT (Functional Connectivity Analysis Toolbox) and written exclusively in MATLAB, to analyse sets of continuous neuro- physiological signals, such as EEGs and LFPs, as well as spike train data, with re- spect to the potential functional connectivity of the neuronal ensembles that gener- ated the signals. FunCAT performs VAR modelling of the input signals and applies most of the statistical tools, described in the previous chapter, to assess any direc- tional interactions between them. In addition to our own custom written routines, many functions are taken from other numerical toolboxes that are available online. Particularly, FunCAT contains (often modified) algorithms from the ARFIT [152,181] (http://www.gps.caltech.edu/ tapio/arfit/ ), Biosig (http://biosig.sourceforge.net/ documentation.html) and Neurospec 20 (http://www.neurospec.org/ ) numerical tool- boxes.
Chapter 3: Assessing Cortico-Hippocampal Connectivity During Anaesthesia
Our goal was to combine elements from such toolboxes, along with routines on spike processing, data handling and plotting, in one complete and particularly user-friendly package that can be used even by non-experts. Moreover, we believe that simultaneously examining various connectivity tools in a structural analysis study helps in giving a more complete picture of the causalities. This is why FunCAT combines PDC, gPDC, DTF, dDTF, GCI, ordinary coherence and time-domain correlations in an effort to assess such causalities.
The main function that is called to initiate the procedure is named FunCAT. When running it, the first main choice of the user is between:
1. performing an analysis on LPF data (or any similar continuous signals), or 2. an analysis on discrete spike-train data.
Alternatively, the user has the options of computing the average from a set of connec- tivity results, running a demo, or just plotting results from preprocessed data.
If the spike train option is chosen, then the user can choose between preprocessing the spike trains by:
2.a. computing their firing rates in a user-specified binning scheme, or 2.b. applying the FHA with user-specified Nyquist frequency.
In either case, if the processing has already been performed in an earlier run of the code, the user can chose to start the analysis on the first principal components of the processed trains.
To process spike trains through their firing rates, the following steps take place:
2.a.1. The user specifies which file to open and which spike train arrays, that belong to each brain area, will be grouped together.
2.a.2. The length and overlap of the time bins are specified and the firing rate of each train is calculated for each bin.
2.a.3. Principal component analysis is performed on the firing rates of all trains in a particular group and the first principal component (PC ) is returned. The eigenvalues and weights of the three first PCs are displayed, so that the user can assess the variance representation by the first PC.
Chapter 3: Assessing Cortico-Hippocampal Connectivity During Anaesthesia
2.a.4. All firing rates and the first PC of each group are stored and plotted.
2.a.5. The sampling frequency resulting from the binning scheme is calculated through eq. (3.2.2) and displayed.
To process spike trains by the FHA, the first step is the same as step 2.a.1 followed by these steps:
2.b.1. The maximum frequency fmax, over which spectral estimation will take place, is specified. The Nyquist frequency is set to fmax+10 Hz, to avoid any spectral distortions [159].
2.b.2. The kernel convolution of the FHA takes place for each spike train, with a sampling rate of twice the Nyquist frequency.
2.b.3. PCA is performed to group the trains of each brain area and the first PCs are returned.
2.b.4. All processed trains and the first PCs are stored and plotted.
The user can now analyse either the LFPs from each brain area, or the first PCs of spike trains, processed either way, through the following prcedure:
3. The names of the LFP- or PCs-containing arrays are specified. 4. The data are separated into user-specified segments.
5. The model order p is set. Alternatively, the optimal model order can be estimated for each segment according to the FPE and BIC criteria. In the latter case, the optimal orders are returned for each data segment and both criteria are plotted over p.
6. The sampling frequency of the signals is specified, along with the range of frequen- cies over which analysis will be performed.
7. The data of each segment are Z-score normalised.
8. A VARp model is created for each segment, following the ARFIT algorithm [152]. 9. The stability of each model is checked and a warning is displayed if the model is
Chapter 3: Assessing Cortico-Hippocampal Connectivity During Anaesthesia
10. The 95% confidence intervals of the VAR coefficients are calculated (according to a Student’s t-distribution) [152].
11. The “whiteness” of the VAR model residuals is examined by checking whether the correlation matrices of the residuals (up to lag p) are significantly non-zero. This step, along with the stability test, assesses the goodness of fit of the model to the data.
12. The VAR model is Fourier transformed to the frequency domain and spectral analysis takes place along with the calculation of the PDC, gPDC, DTF, dDTF and ordinary coherence over the given frequency range.
13. The critical values of PDC and gPDC are calculated.
14. The Granger Causality Index of each modelled time series is calculated. 15. Ordinary correlations between all pairs of signals are computed.
16. All results are stored in a user-specified file.
17. Results on connectivity are plotted in various ways. The code also plots the power spectra of the original signals along with those calculated through the model, to further assess the goodness of fit of the model to the data.
Finally, FunCAT has a demo routine containing tests with sets of coupled oscillators that help examine the performance of the code and that of the individual statistical measures of causality. The test presented in the previous chapter is among them and all the plots presented there were generated by FunCAT. Moreover, the following results on generalised PDC were also derived from our code.