<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Thank you Jan-Mathijs for your opinion and suggestions! Thanks, Alik for the paper, this looks interesting.
<div class=""><br class="">
</div>
<div class="">Now that I applied non-parametrically calculated Granger-causality for my data, I have to follow-up questions:</div>
<div class=""><br class="">
</div>
<div class="">1. During the computation of spectral factorisation, the implementation of Wilson’s algorithm complains that “when performing non-parametric spectral factorisation the frequency axis should ideally be zero-padded”. I guess this means that the
 frequency axis should start at 0. However, as far as I can see that’s not possible using ft_freqanalysis. The code then goes on and performs the zero-padding. I don’t really understand why exactly it does the padding the way it does: it seems to add other
 frequencies as well, so that the frequency axis the algorithm is actually working with starts with 0 and is followed by some frequencies that are even higher than the first frequency from the original axis, before the original axis is starts.</div>
<div class=""><br class="">
</div>
<div class="">So my questions are: Should I be concerned about this warning? Why is the zero-padding of the frequency axis so weird?</div>
<div class=""><br class="">
</div>
<div class="">2. I found that when I apply the GC computation to my data there seems to be some kind of edge artefact at the highest frequencies when I average across combinations that represent the same anatomical direction (see attached plot).</div>
<div class="">Why do I get this effect and is it related to my first question?</div>
<div class=""><br class="">
</div>
<div class="">Best,</div>
<div class=""><br class="">
</div>
<div class="">Daniel<img height="493" width="720" apple-width="yes" apple-height="yes" apple-inline="yes" id="A6ADBAFA-EA83-443E-901E-D19418A10817" src="cid:6282C030-CD90-405E-BCED-AD7F0DDA754A" class=""></div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 29 Oct 2015, at 10:42, Alik Widge <<a href="mailto:alik.widge@gmail.com" class="">alik.widge@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">You may also find this informative:<br class="">
<a href="http://www.sciencedirect.com/science/article/pii/S1053811915003316" class="">http://www.sciencedirect.com/science/article/pii/S1053811915003316</a><br class="">
<br class="">
</div>
Disclaimer: I have not personally tried this yet, although it's on our list for a near future.<br class="">
</div>
<div class="gmail_extra"><br clear="all" class="">
<div class="">
<div class="gmail_signature">
<div dir="ltr" class="">Alik Widge<br class="">
<a href="mailto:alik.widge@gmail.com" target="_blank" class="">alik.widge@gmail.com</a><br class="">
(206) 866-5435<br class="">
<br class="">
</div>
</div>
</div>
<br class="">
<div class="gmail_quote">On Thu, Oct 29, 2015 at 2:49 AM, Schoffelen, J.M. (Jan Mathijs)
<span dir="ltr" class=""><<a href="mailto:jan.schoffelen@donders.ru.nl" target="_blank" class="">jan.schoffelen@donders.ru.nl</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Daniel<br class="">
<br class="">
> I am currently computing the Granger causality between LFP signals from different brain regions. As it turns out, this is a more challenging endeavour than I had previously thought.<br class="">
<br class="">
Has anyone said to you it would not be challenging ;o)?<br class="">
<br class="">
> While testing parametric and non-parametric approaches to computing Granger causality, I came across some behaviour which seems odd to me. I hope someone can shed light on these issues:<br class="">
><br class="">
> 1. Using the parametric approach (ft_mvaranalysis -> ft_freqanalysis -> ft_connectivityanalysis) I found that ft_freqanalysis can’t deal with MVAR data that contains a trial dimension. The first error is actually that it can’t find the field ‘label’, and
 this is true: if you run ft_mvaranalysis with cfg.keeptrials = ‘yes’, the resulting structure lacks the ‘label’ field. However, if I manually copy the ‘label’ field from the original data to the MVAR data, ft_freqanalysis stops at some point where it uses
 an array that lacks one dimension.<br class="">
<br class="">
OK, this could (or could not) be a general issue with the code. The part of FieldTrip that deals with AR-modelling is quite old, and it could be that more recent changes in other parts of the code (e.g. concerning with data bookkeeping) destroyed some of the
 functionality. None of the developers are actively using AR-models in their daily research nowadays, so it could be that this code is a bit stale. This being said, in general I don’t think it is a good idea to fit an AR-model to a single trial worth of data.
 This would probably lead to not so meaningful estimates. It would be more meaningful to use a jackknife approach, where a variance across trials (or some measure that quantifies the extent to which a single trial differs from the rest) can be obtained with
 a leave-one-out approach.<br class="">
<br class="">
> 2. Using the non-parametric approach (ft_freqanalysis -> ft_connectivityanalysis) I stumbled across the problem that the implementation of Wilson’s algorithm that computes the factorisation of the spectral density matrix doesn’t allow non-integer frequencies
 nor non-equal distances between frequencies. Is this an inherent limitation of this algorithm?<br class="">
<br class="">
Yes.<br class="">
<br class="">
> 3. Again for the non-parametric approach: If I use trial-resolved FREQ data for ft_connectivityanalysis, the trial dimension is lost at line 389 if I use data contain a ‘fourierspctrm’ field. If I use data containing a ‘powspctrm’ field, it takes literally
 hours at line 392 to ‘fix’ the CSD at line 585 in ft_checkdata (which uses ‘fixcsd’) for every trial. This is not resolved by using FREQ data which has both a ‘powspctrm’ as well as a ‘crsspctrm’ field.<br class="">
<br class="">
The input into ft_connectivityanalysis should be a frequency domain data structure containing either a ‘fourierspctrm’ (obtained with cfg.output=‘fourier’), or a crsspctrm/powspctrm (obtained with cfg.output=‘powandcsd’). Specifying cfg.output=‘pow’ does not
 make sense. I would expect it to crash, if it doesn’t we should consider making the error handling more strict. Also, for Wilson’s algorithm, the estimate of the cross-spectral density needs to be somewhat robust, and a single trial estimate in my opinion
 does not really make sense. The step at which the fourierspctrm representation is converted into the cross-spectrum ‘knows’ this, and kicks out the trial dimension. The ‘fixcsd’ step in ft_checkdata can in deed be notoriously slow in some cases, which can
 be prevented to start from the right format of the data to begin with (as per ft_freqanalysis).<br class="">
<br class="">
> I’m not really sure whether I need trial-resolved Granger-causality, but in theory this should be possible. Of course, I could work around this issue by just using 1-trial FREQ data for ft_connectivityanalysis.<br class="">
<br class="">
Please do.<br class="">
<br class="">
<br class="">
Best,<br class="">
Jan-Mathijs<br class="">
<br class="">
<br class="">
<br class="">
><br class="">
> Thanks in advance for your ideas!<br class="">
><br class="">
> All the best,<br class="">
><br class="">
> Daniel<br class="">
> --<br class="">
> Daniel Hähnke<br class="">
> PhD student<br class="">
><br class="">
> Technische Universität München<br class="">
> Institute of Neuroscience<br class="">
> Translational NeuroCognition Laboratory<br class="">
> Biedersteiner Straße 29, Bau 601<br class="">
> 80802 Munich<br class="">
> Germany<br class="">
><br class="">
> Email: <a href="mailto:daniel.haehnke@tum.de" class="">daniel.haehnke@tum.de</a><br class="">
> Phone: <a href="tel:%2B49%2089%204140%203356" value="+498941403356" class="">+49 89 4140 3356</a><br class="">
><br class="">
><br class="">
> _______________________________________________<br class="">
> fieldtrip mailing list<br class="">
> <a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">
> <a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank" class="">
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank" class="">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
</blockquote>
</div>
<br class="">
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>