<div dir="ltr">Hi all<br><div><br>I'd like to get some insight from you for transfer entropy analysis of my ECoG data before I run all possible parameters.<br><br>
<div>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.<br>
<br></div><div>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. <br>

</div><div><br></div><div>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.<br><br></div><div>OR do you think granger causality is better? But granger causality wants your data to satisfy several requirements. So I went for Transfer Entropy...<br>
</div><div>
<br>cfgTEP.toi = [min(data.time{1,1})  max(data.time{1,1})] <span style="color:rgb(0,0,255)">--> Basically from trial start to trial end.</span><br><br>cfgTEP.predicttimemin_u= 10;<br>cfgTEP.predicttimemax_u= 240;  <span style="color:rgb(0,0,255)">--> 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?<br>
<br><span style="color:rgb(0,0,0)">cfgTEP.actthrvalue = 100;  </span> 
--> 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?<br>
<br><span style="color:rgb(0,0,0)">cfgTEP.maxlag      = 1000; </span> --> 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)?<br>
<br><span style="color:rgb(0,0,0)">cfgTEP.minnrtrials = 7; </span>
 --> 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? <br>
</span></div><div><span style="color:rgb(0,0,255)"><br></span></div><div><span style="color:rgb(0,0,255)"><font color="#000000">For main parameters for TEragwitz,<br><br>cfgTEP.optimizemethod ='ragwitz';<br>cfgTEP.ragdim         = 1:10;  <font color="#0000ff">--> I just chose all possible embedding dimension from 1 to 10. Should I try to put more than 10?</font> <span style="color:rgb(0,0,255)">But
 TE analysis always says, embedding dimension maybe 2, which sounds 
about right for pure sine waves like<font color="#000000"> </font>SSVEPs. But with 0.1Hz~500hz 
bandpass, I have tons of non-stimulus locked low and high noisy activities. But </span><span style="color:rgb(0,0,255)">when I chose Cao's method, it says, 5 or 6<font color="#000000">. </font></span><br>
<br>cfgTEP.ragtaurange    = [0.1 2]; <span style="color:rgb(0,0,255)">-->
 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.</span><br>
<br>cfgTEP.ragtausteps    = 15;         % steps for ragwitz tau steps 15<br><br>cfgTEP.repPred        = 600;  <span style="color:rgb(0,0,255)">--> I just chose this<font color="#000000">.</font> I could vary this. Depending on what I put here, final significance of TE changes too.</span><br>

<br>cfgTEP.flagNei = 'Mass' ;           %neigbour analyse type<br><br>cfgTEP.sizeNei = 4;  <font color="#0000ff">-->
 Ideally I guess I might have to vary size of neighborhood in phase space<br>
<span style="color:rgb(0,0,0)"><br></span></font></font></span></div><div><span style="color:rgb(0,0,255)"><font color="#000000"><font color="#0000ff"><span style="color:rgb(0,0,0)"><br>For Surrogate analysis, </span></font></font></span><span style="color:rgb(0,0,255)"><font color="#000000"><font color="#0000ff"><span style="color:rgb(0,0,0)"><br>

<br>cfgTESS.optdimusage = 'indivdim';</span> <br><span style="color:rgb(0,0,0)">cfgTGAA.select_opt_u     = 'product_evidence'; % 'max_TEdiff'; -<font color="#0000ff">-> 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?</font><br>

<br>cfgTGAA.select_opt_u_pos = 'shortest'; <span style="color:rgb(0,0,255)">--> Also for this, I don't know which one is normal to use.</span><br><br></span></font></font></span></div><div><span style="color:rgb(0,0,255)"><font color="#000000"><font color="#0000ff"><span style="color:rgb(0,0,0)">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.</span><br>
<span style="color:rgb(0,0,0)"><br></span></font></font></span></div><div>Thank you very much.<br></div>Have a nice day.<br><br><br></div><div>========================<br>========================<br></div><div>code here<br>
<br></div><div>load data<br><br>%% define cfg for TEprepare.m<br>cfgTEP = [];<br><br>% path to OpenTSTOOL<br>cfgTEP.Path2TSTOOL = '../OpenTSTOOL'; %strcat(work_dir,'toolboxes/','OpenTSTOOL');<br><br>
% data<br>cfgTEP.toi                 = [min(data.time{1,1})  max(data.time{1,1})]; % time of interest<br>% cfgTEP.sgncmb              = {'2' '43'};  % channels to be analyzed<br>% or:<br>datalabels = data.label; %select channels for TE compute<br>
cfgTEP.channel = datalabels;<br><br>% scanning of interaction delays u<br>cfgTEP.predicttimemin_u= 41;           % minimum u to be scanned<br>cfgTEP.predicttimemax_u= 240;           % maximum u to be scanned<br>cfgTEP.predicttimestepsize = 1;        % time steps between u's to be scanned<br>
<br>% estimator<br>cfgTEP.TEcalctype='VW_ds'; % use the new TE estimator (Wibral, 2013)<br><br>% ACT estimation and constraints on allowed ACT(autocorelation time)<br>cfgTEP.actthrvalue = 100;   % threshold for ACT<br>
cfgTEP.maxlag      = 1000; <br>cfgTEP.minnrtrials = 7;    % minimum acceptable number of trials<br><br>% optimizing embedding<br>cfgTEP.optimizemethod ='ragwitz';  % criterion used<br>cfgTEP.ragdim         = 1:10;       % criterion dimension<br>
cfgTEP.ragtaurange    = [0.1 2];   % range for tau<br>cfgTEP.ragtausteps    = 15;         % steps for ragwitz tau steps 15<br>cfgTEP.repPred        = 600;      % size(data.trial{1,1},2)*(3/4);<br><br>% kernel-based TE estimation<br>
cfgTEP.flagNei = 'Mass' ;           %neigbour analyse type<br>cfgTEP.sizeNei = 4;                 %neigbours to analyse<br><br>% optimizing embedding<br>% cfgTEP.optimizemethod = 'cao';<br>% cfgTEP.caodim = 1:10;<br>
% cfgTEP.caokth_neighbors = 4;<br><br>%% define cfg for TEsurrogatestats_ensemble.m<br>cfgTESS= [];<br><br>% use individual dimensions for embedding<br>cfgTESS.optdimusage = 'indivdim';<br><br>% statistical and shift testing<br>
cfgTESS.tail           = 1;<br>cfgTESS.numpermutation = 5e4;<br>cfgTESS.shifttesttype  ='TEshift>TE';<br>cfgTESS.surrogatetype  = 'blockreverse1'; %'trialshuffling';<br><br>% results file name<br>
data_save_path = strcat(data_dir,'TE');<br>if ~isdir(data_save_path);<br>mkdir(data_save_path);<br>end<br><br>partial_save_dir = strcat(data_save_path,'/','dataset');<br>if ~isdir(partial_save_dir);<br>
mkdir(partial_save_dir);<br>end<br><br>cfgTESS.fileidout = strcat(partial_save_dir,'/','dataset');<br><br>%% calculation - scan over specified values for u<br>f_time=tic;<br><br>TGA_results=InteractionDelayReconstruction_calculate(cfgTEP,cfgTESS,data);<br>
<br>toc(f_time);<br><br>savename=strcat(data_save_path,'/','dataset_results');<br>save(savename,'TGA_results');<br><br>%% analysis - find maximum TE value to reconstruct the interaction delay u<br>
<br>cfgTGAA = [];<br><br>cfgTGAA.select_opt_u     = 'product_evidence'; % 'max_TEdiff';<br>cfgTGAA.select_opt_u_pos = 'shortest';<br> <br>TGA_analyzed=InteractionDelayReconstruction_analyze(cfgTGAA,TGA_results);<br>
 <br>savename2=strcat(data_save_path,'/','dataset_complete_analyzed.mat');<br>save(savename2,'TGA_analyzed');<br></div></div>