This is the readme for the models associated with the paper:

Ursino M, Ricci G, Magosso E (2020)
Transfer entropy as a measure of brain connectivity: a critical analysis with the help of neural mass models
Frontiers in Computational Neuroscience

This archive was contributed by M Ursino.

Three programs are included in the repository, to allow a complete reproduction of all results, with suitable
parameter choices.
It is worth noting that all parameters in the present codes refer to the simulation of panel 5 a in the
manuscript, and to the plot of the overall Fig. 5. All other data analysed in the manuscript, can be
generated, and all figures re-drawn, by changing the parameters in the programs and repeating the
processing, as illustrated below (see ReadMe_G.pdf for details).
Data_Generation.m
The program “Data_Generation.m” allows the simulation of the Neural Mass Model, and the memorization
of results in a file. In the present example the file is named “sim_data_Fig5_0a.mat” (line 165) and this
name should be changed in all simulations.
The parameters of the Neural Mass Model that should be changed to allow different simulations are:
Npop : number of interconnected regions; (Fig. 3, Fig. 4, Fig. 5, Fig. 6, Fig. 7)
Wp : array containing the excitatory synapses (dimension Npop x Npop) where the rows represent the
target ROIs and the columns the source ROIs; (Fig. 3, Fig. 4, Fig. 5, Fig. 6, Fig. 7)
Wf : array containing the inhibitory synapses (dimension Npop x Npop) where the rows represent the
target ROIs and the columns the source ROIs; (Fig. 3, Fig. 4, Fig. 5, Fig. 6, Fig. 7)
m1 : mean value of the input noise to ROI 1; (first panel row in Fig. 8)
m2 : mean value of the input noise to ROI 2; (Fig. 9)
sigma_p1 : power density of the input noise to ROI 1; (second panel row in Fig. 8)
sigma_p : power density of the input noise to ROI 1 and 2; (third panel row in Fig. 8)
D : delay between interconnected ROIs; (Fig. 10)
tend : signal length; (Fig. 11)
The program performs 10 simulations with different noise and memorizes 10 EEG signals, the time vector,
and the connectivity arrays, Wp and Wf.
TE_calculation.m
The program “TE_calculation.m” reads the data from a previous simulation. In this example, loads the file
“sim_data_Fig5_0a.mat” (line 8) previously generated with the program “Data-Generation.m” and
computes the values of Transfer entropy. All results are stored in a file. In the present example this is
named “TE_data_Fig5_0a.mat” (line 81). In particular, the data structure 'TGA_results' contains all results
generated with the software Trentool, as specified in the Supplementary Material 1. It is worth noting that,
before running, this program, the user must install the Trentool software package (see
http://www.trentool.de/ for more details).
It is worth noting that Trentool also generates additional mat files, that are not used by us.Figure5.m
This program generates all panels in Fig. 5, starting from the values of Transfer Entropy previously
computed by the program “TE_calculation.m” and stored in different files. By way of example, all mat files
used to produce the figure are included in the directory. These files can also be generated by the user as
suggested above. These mat files are an example of how files should be generated and structured to
produce all data and plot figures.
In the case of Figs. 8 and 9 of the manuscript, entropy is also computed from the simulated EEG data, using
the matlab command “entropy” contained in the Image Processing toolbox.
Fig. 7 contains bar figures, generated with the Matlab command Bar.
Finally, in order to reproduce figures contained in the Supplementary Material 2, the user should replace
the computation of TE with the computation of the delayed correlation coefficient. This is computed using
the Matlab command “corr”, with the target signal delayed by two steps (20 ms) with respect to the source
signal. Only in case of the first and third panels of Fig. 10, the delays were one step (10 ms) and three steps
(30 ms), respectively.

Please see the included ReadMe_G.pdf for details on the parameters for the figures.