[FieldTrip] Questions about transfer entropy

woun zoo instanton at gmail.com
Wed Jan 22 22:27:21 CET 2014


Hi all

I'd like to get some insight from you for transfer entropy analysis of my
ECoG data before I run all possible parameters.

I'd like to establish some connectivity between frontal and visual channels
in ECoG recording.  However, in our data, there is a very strong driven
component, namely, steady state visually evoked potentials.  SSVEPs in our
data appear at several frequencies that are harmonics of the input
frequencies and their sum and difference frequencies. So our data has a
completely deterministic (SSVEPs) dynamics and the rest of stochastic
(non-stimulus locked) activities.

Data has 20 trials in total. Each trial lasts 2.4sec. Sampling rate is
1200hz. Raw data were bandpass filtered from 0.1Hz to 500hz.

In order to find an effective connectivity, I chose to use TRENTOOL box for
transfer entropy. I used Ragwitz method from TRENTOOL (nonlinear locally
constant prediction method). This is where I'd like to get some good
insight for choosing parameters. Just below, I wrote my questions in blue
text. I'm sorry to bother you with all these. But I really want to get some
good insight from you because I am not exactly sure if I'm putting garbage
inputs or not. At the end of this email, I put my code.

OR do you think granger causality is better? But granger causality wants
your data to satisfy several requirements. So I went for Transfer Entropy...

cfgTEP.toi = [min(data.time{1,1})  max(data.time{1,1})] --> Basically from
trial start to trial end.

cfgTEP.predicttimemin_u= 10;
cfgTEP.predicttimemax_u= 240;  --> I am not sure where and how these min
and max were used in TEragwitz calculation in TEprepare.m. VW_ds fixed 1 as
a prediction horizon. I'm not sure if it's good to predict just next time
sample point for SSVEP + noisy data?

cfgTEP.actthrvalue = 100;   --> I don't know the reason why this
autocorrelation time value needs to be set by hand cause I thought
embedding delay time gets automatically decided by autocorrelation. Is
there a special logic behind setting this by hand? For particular two
channels, their ACT values were 54 sample points, etc. Max ACT was 134 or
something. Is this due to noise? If I have strong oscillatory activities,
am I not supposed to see ACT values close to oscillatory period?

cfgTEP.maxlag      = 1000;  --> 1000 is default. What will be a good lag
number to see autocorrelation? Should I use a half of total sample points
of data (2880/2 = 1440)?

cfgTEP.minnrtrials = 7;  --> Does this mean if trial selection rule by ACT
value rejects more than 13 trials out of total 20 trials, program won't
run? What is a good number for this when I have 20 trials?

For main parameters for TEragwitz,

cfgTEP.optimizemethod ='ragwitz';
cfgTEP.ragdim         = 1:10;  --> I just chose all possible embedding
dimension from 1 to 10. Should I try to put more than 10? But TE analysis
always says, embedding dimension maybe 2, which sounds about right for pure
sine waves like SSVEPs. But with 0.1Hz~500hz bandpass, I have tons of
non-stimulus locked low and high noisy activities. But when I chose Cao's
method, it says, 5 or 6.

cfgTEP.ragtaurange    = [0.1 2]; --> For delay time, I chose this range.
But Ragwitz always chose the smallest value. If I put this range from [1
2], then it chooses 1. If it was [0.5 3], it chose 0.5. So I'd really like
to know what kind of values I should put here.

cfgTEP.ragtausteps    = 15;         % steps for ragwitz tau steps 15

cfgTEP.repPred        = 600;  --> I just chose this. I could vary this.
Depending on what I put here, final significance of TE changes too.

cfgTEP.flagNei = 'Mass' ;           %neigbour analyse type

cfgTEP.sizeNei = 4;  --> Ideally I guess I might have to vary size of
neighborhood in phase space


For Surrogate analysis,

cfgTESS.optdimusage = 'indivdim';
cfgTGAA.select_opt_u     = 'product_evidence'; % 'max_TEdiff'; --> I just
chose 'product_evidence' because help file of
InteractionDelayReconstruction_analyze.m says 'max_TEdiff' could be
problematic in certain case. Which one is normal to use?

cfgTGAA.select_opt_u_pos = 'shortest'; --> Also for this, I don't know
which one is normal to use.

I'm sorry if this questions are too hectic. I really appreciate if you
could give me some good insight about parameters for ECoG steady-state
visual evoked potential data.

Thank you very much.
Have a nice day.


========================
========================
code here

load data

%% define cfg for TEprepare.m
cfgTEP = [];

% path to OpenTSTOOL
cfgTEP.Path2TSTOOL = '../OpenTSTOOL';
%strcat(work_dir,'toolboxes/','OpenTSTOOL');

% data
cfgTEP.toi                 = [min(data.time{1,1})  max(data.time{1,1})]; %
time of interest
% cfgTEP.sgncmb              = {'2' '43'};  % channels to be analyzed
% or:
datalabels = data.label; %select channels for TE compute
cfgTEP.channel = datalabels;

% scanning of interaction delays u
cfgTEP.predicttimemin_u= 41;           % minimum u to be scanned
cfgTEP.predicttimemax_u= 240;           % maximum u to be scanned
cfgTEP.predicttimestepsize = 1;        % time steps between u's to be
scanned

% estimator
cfgTEP.TEcalctype='VW_ds'; % use the new TE estimator (Wibral, 2013)

% ACT estimation and constraints on allowed ACT(autocorelation time)
cfgTEP.actthrvalue = 100;   % threshold for ACT
cfgTEP.maxlag      = 1000;
cfgTEP.minnrtrials = 7;    % minimum acceptable number of trials

% optimizing embedding
cfgTEP.optimizemethod ='ragwitz';  % criterion used
cfgTEP.ragdim         = 1:10;       % criterion dimension
cfgTEP.ragtaurange    = [0.1 2];   % range for tau
cfgTEP.ragtausteps    = 15;         % steps for ragwitz tau steps 15
cfgTEP.repPred        = 600;      % size(data.trial{1,1},2)*(3/4);

% kernel-based TE estimation
cfgTEP.flagNei = 'Mass' ;           %neigbour analyse type
cfgTEP.sizeNei = 4;                 %neigbours to analyse

% optimizing embedding
% cfgTEP.optimizemethod = 'cao';
% cfgTEP.caodim = 1:10;
% cfgTEP.caokth_neighbors = 4;

%% define cfg for TEsurrogatestats_ensemble.m
cfgTESS= [];

% use individual dimensions for embedding
cfgTESS.optdimusage = 'indivdim';

% statistical and shift testing
cfgTESS.tail           = 1;
cfgTESS.numpermutation = 5e4;
cfgTESS.shifttesttype  ='TEshift>TE';
cfgTESS.surrogatetype  = 'blockreverse1'; %'trialshuffling';

% results file name
data_save_path = strcat(data_dir,'TE');
if ~isdir(data_save_path);
mkdir(data_save_path);
end

partial_save_dir = strcat(data_save_path,'/','dataset');
if ~isdir(partial_save_dir);
mkdir(partial_save_dir);
end

cfgTESS.fileidout = strcat(partial_save_dir,'/','dataset');

%% calculation - scan over specified values for u
f_time=tic;

TGA_results=InteractionDelayReconstruction_calculate(cfgTEP,cfgTESS,data);

toc(f_time);

savename=strcat(data_save_path,'/','dataset_results');
save(savename,'TGA_results');

%% analysis - find maximum TE value to reconstruct the interaction delay u

cfgTGAA = [];

cfgTGAA.select_opt_u     = 'product_evidence'; % 'max_TEdiff';
cfgTGAA.select_opt_u_pos = 'shortest';

TGA_analyzed=InteractionDelayReconstruction_analyze(cfgTGAA,TGA_results);

savename2=strcat(data_save_path,'/','dataset_complete_analyzed.mat');
save(savename2,'TGA_analyzed');
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140122/b1e72df9/attachment-0001.html>


More information about the fieldtrip mailing list