<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr">
<div id="OWAFontStyleDivID" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi Jan-Mathijs,</p>
<p> </p>
<p>    Thank you for the quick response and for pointing out my problem with scaling the y-axis. Your suggestion pointed be to another issue: while the Granger spectra output from the non-conditional calculation is organized as 3x3xNFreqs (for a trivariate
 system),  the conditional Granger output is a flat list of 6xNFreqs. I am now getting the correct, frequency resolved results in both cases. I will attach my code in case it can be of help in the future.</p>
<p> </p>
<p>    If there is a convenient reference for the calculation in blockwise_conditionalgranger.m, I would still be interested in seeing it.</p>
<p> </p>
<p>    Thanks again,</p>
<p> </p>
<p>-Per</p>
<p> </p>
<p></p>
<div style="color: rgb(40, 40, 40);">
<hr tabindex="-1" style="width: 98%; display: inline-block;">
<div id="divRplyFwdMsg" dir="ltr"><font color="#000000" face="Calibri, sans-serif" style="font-size: 11pt;"><b>From:</b> fieldtrip-bounces@science.ru.nl <fieldtrip-bounces@science.ru.nl> on behalf of jan-mathijs schoffelen <jan.schoffelen@donders.ru.nl><br>
<b>Sent:</b> Tuesday, June 10, 2014 2:15 AM<br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> Re: [FieldTrip] Non-Parametric Conditional Granger Causality</font>
<div> </div>
</div>
<div>Dear Per,
<div><br>
</div>
<div>Thanks for sending along the very clear code, makes it easy to run and verify ;-).</div>
<div>I think that it went quite OK. Using conditional Granger in this example would hopefully leading to the conclusion Z is Granger-causing X and Y is Granger-causing Z. Your fourier_granger variable (with conditioning) shows just that. The thing is, that
 the magnitude for some reason are much larger than the y-axis scale you chose for visualization. If you do a plot(fourier_granger.freq, fourier_granger.grangerspctrm), you’ll see that there are 2 lines that show non-zero values.</div>
<div><br>
</div>
<div>Best wishes,</div>
<div>Jan-Mathijs</div>
<div><br>
<div>
<div>
<div>On Jun 9, 2014, at 10:04 PM, Per Arnold Lysne <<a href="mailto:lysne@unm.edu">lysne@unm.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="font: 12px/normal Helvetica; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal;" dir="ltr">
<div id="OWAFontStyleDivID" style="font-family: Calibri,Arial,Helvetica,sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">
<div style="margin-top: 0px; margin-bottom: 0px;">Hello,</div>
<p style="margin-top: 0px; margin-bottom: 0px;"> </p>
<div style="margin-top: 0px; margin-bottom: 0px;">    I am trying to use non-parametric Granger spectral decomposition on a simple, artificial MVAR system:</div>
<p style="margin-top: 0px; margin-bottom: 0px;"> </p>
<div style="margin-top: 0px; margin-bottom: 0px;">x(t) = 0.80*x(t-1) - 0.50*x(t-2) + 0.40*z(t-1)</div>
<div style="margin-top: 0px; margin-bottom: 0px;">y(t) = 0.53*y(t-1) - 0.80*y(t-2)</div>
<div style="margin-top: 0px; margin-bottom: 0px;">z(t) = 0.50*z(t-1) - 0.20*z(t-2) + 0.50*y(t-1)</div>
<p style="margin-top: 0px; margin-bottom: 0px;"> </p>
<div style="margin-top: 0px; margin-bottom: 0px;">    This example system is drawn from Dhamala, Rangarajan, & Ding, 2008, NeuroImage, where is it used to demonstrate "prima facie", or erroneous conclusions about causality when the conditional decomposition
 is not used (i.e. in the system itself y->z->x, but an additional link y->x is seen when the non-conditional granger calculation is used).</div>
<p style="margin-top: 0px; margin-bottom: 0px;"> </p>
<div style="margin-top: 0px; margin-bottom: 0px;">    In my code and output included below, the Fourier power and non-conditional Granger output are as expected, but the conditional Granger output appears to be uniformly near zero.</div>
<p style="margin-top: 0px; margin-bottom: 0px;"> </p>
<div style="margin-top: 0px; margin-bottom: 0px;">    The only difference between the two cases in my code is the setting of a single parameter passed to ft_connectivityanalsysis, cfg.granger.conditional being 'no' and 'yes' in the respective cases.</div>
<p style="margin-top: 0px; margin-bottom: 0px;"> </p>
<div style="margin-top: 0px; margin-bottom: 0px;">    My apologies if I have missed an archived post addressing this issue, as this is quite likely to be an error on my part. Alternatively, I do not recognize the calculation being performed in blockwise_conditionalgranger.m.
 If someone has a reference to this, I may be able to figure this out myself (I am working from Chen, Bressler, & Ding, 2006, "Frequency decomposition of conditional Granger causality and application to multivariate neural field potential data", Journal of
 Neuroscience Methods).</div>
<p style="margin-top: 0px; margin-bottom: 0px;"> </p>
<div style="margin-top: 0px; margin-bottom: 0px;">    Thank you for your help,</div>
<p style="margin-top: 0px; margin-bottom: 0px;"> </p>
<div style="margin-top: 0px; margin-bottom: 0px;">Per A. Lysne</div>
<div style="margin-top: 0px; margin-bottom: 0px;">University of New Mexico</div>
<div style="margin-top: 0px; margin-bottom: 0px;"><a href="mailto:lysne@unm.edu">lysne@unm.edu</a></div>
<p style="margin-top: 0px; margin-bottom: 0px;"> </p>
<p style="margin-top: 0px; margin-bottom: 0px;"> </p>
<p style="margin-top: 0px; margin-bottom: 0px;"> </p>
<p style="margin-top: 0px; margin-bottom: 0px;"> </p>
<div style="margin-top: 0px; margin-bottom: 0px;">The first image is the Fourier power spectra of the system (abs applied to complex-valued cross-power). The second image is the non-conditional Granger decomposition, and the third image the conditional Granger.
 My convention for plotting is "row-causes-column". Results are generated using 100 trials of 300 samples apiece with an assumed sampling frequency of 200 Hz. Software is Matlab R2012a, Student Edition, and my Fieldtrip download is dated 6/3/2014. The code
 which generated these images is attached.</div>
<p style="margin-top: 0px; margin-bottom: 0px;"> </p>
<p style="margin-top: 0px; margin-bottom: 0px;"> </p>
<div style="margin-top: 0px; margin-bottom: 0px;"><span><MVAR2.Spectra.jpg></span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span><MVAR2.NonCondGranger.jpg></span><span><MVAR2.CondGranger.jpg></span></div>
</div>
<span><pal_test_ft_granger_cond.m></span>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div>
</blockquote>
</div>
<br>
<div><span class="Apple-style-span" style="color: rgb(0, 0, 0); text-transform: none; line-height: normal; text-indent: 0px; letter-spacing: normal; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); text-transform: none; line-height: normal; text-indent: 0px; letter-spacing: normal; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2;">
<div style="-ms-word-wrap: break-word;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); text-transform: none; line-height: normal; text-indent: 0px; letter-spacing: normal; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2;">
<div style="-ms-word-wrap: break-word;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); text-transform: none; line-height: normal; text-indent: 0px; letter-spacing: normal; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2;">
<div style="-ms-word-wrap: break-word;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); text-transform: none; line-height: normal; text-indent: 0px; letter-spacing: normal; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2;">
<div style="-ms-word-wrap: break-word;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); text-transform: none; line-height: normal; text-indent: 0px; letter-spacing: normal; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2;">
<div style="-ms-word-wrap: break-word;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); text-transform: none; line-height: normal; text-indent: 0px; letter-spacing: normal; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2;">
<div style="-ms-word-wrap: break-word;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); text-transform: none; line-height: normal; text-indent: 0px; letter-spacing: normal; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2;">
<div style="-ms-word-wrap: break-word;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); text-transform: none; line-height: normal; text-indent: 0px; letter-spacing: normal; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2;">
<div style="-ms-word-wrap: break-word;">
<div>Jan-Mathijs Schoffelen, MD PhD </div>
<div><br>
</div>
<div>Donders Institute for Brain, Cognition and Behaviour, <br>
Centre for Cognitive Neuroimaging,<br>
Radboud University Nijmegen, The Netherlands</div>
<div><br>
</div>
<div>Max Planck Institute for Psycholinguistics,</div>
<div>Nijmegen, The Netherlands</div>
<div><br>
</div>
<div><a href="mailto:J.Schoffelen@donders.ru.nl">J.Schoffelen@donders.ru.nl</a></div>
<div>Telephone: +31-24-3614793</div>
<div><br>
</div>
<div><a href="http://www.hettaligebrein.nl">http://www.hettaligebrein.nl</a></div>
</div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></span></div>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>