<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Daniel,
<div class=""><br class="">
</div>
<div class="">If you only have 5 trials in your input data, the estimate itself will be enormously biased, and possibly by consequence is the bias correction ‘overshooting’.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 13 Jun 2019, at 19:10, <a href="mailto:daniel.strahnen@uni-ulm.de" class="">
daniel.strahnen@uni-ulm.de</a> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Dear Fieldtrippers,<o:p class=""></o:p></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class="">I am a doctoral student and my research fields are local field potentials (LFPs).<span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class="">Therefore I wanted to calculate the weighted phase lag index which is implemented in the Fieldtrip toolbox.<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class="">The data I want to analyse has the following structure:<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class="">data =<span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class="">  struct with fields:<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class="">      label: {7×1 cell}<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class="">       time: {1×5 cell}<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class="">      trial: {1×5 cell}<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class="">    fsample: 1000                  % Seven channels and five trials<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class="">The code I produced for the wPLI is the following:<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New"; color: forestgreen;" class="">%% Freqanalysis to obtain the cross spectral density</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">cfg_freq = [];</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">cfg_freq.method =<span class="Apple-converted-space"> </span></span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New"; color: rgb(160, 32, 240);" class="">'mtmfft'</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">;</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">cfg_freq.output =<span class="Apple-converted-space"> </span></span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New"; color: rgb(160, 32, 240);" class="">'powandcsd'</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">;</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">cfg_freq.channel = {</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New"; color: rgb(160, 32, 240);" class="">'CH2'</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><span class="Apple-converted-space"> </span></span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New"; color: rgb(160, 32, 240);" class="">'CH4'</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">};</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">cfg_freq.keeptrials =<span class="Apple-converted-space"> </span></span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New"; color: rgb(160, 32, 240);" class="">'yes'</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">;<span class="Apple-converted-space"> </span></span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New"; color: forestgreen;" class="">%
 do not return an average of all trials for subsequent wpli analysis</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">cfg_freq.taper =<span class="Apple-converted-space"> </span></span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New"; color: rgb(160, 32, 240);" class="">'dpss'</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">;</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">cfg_freq.tapsmofrq = 1;</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">cfg_freq.foilim = [0 48];</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">freq_data = ft_freqanalysis(cfg_freq, data);</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""></span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New"; color: forestgreen;" class="">%% WPLI analysis</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">cfg_conn = [];</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">cfg_conn.method =<span class="Apple-converted-space"> </span></span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New"; color: rgb(160, 32, 240);" class="">'wpli_debiased'</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">;</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">wpli = ft_connectivityanalysis(cfg_conn, freq_data);</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">wpli = ft_checkdata(wpli,<span class="Apple-converted-space"> </span></span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New"; color: rgb(160, 32, 240);" class="">'cmbrepresentation'</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">,<span class="Apple-converted-space"> </span></span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New"; color: rgb(160, 32, 240);" class="">'full'</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">,</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New"; color: rgb(160, 32, 240);" class="">'datatype'</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">,</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New"; color: rgb(160, 32, 240);" class="">'freq'</span><span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class="">);<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-family: "Courier New";" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class="">I now have two questions:<o:p class=""></o:p></span></div>
<ol start="1" type="1" style="margin-bottom: 0cm; margin-top: 0cm;" class="">
<li class="MsoListParagraph" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<span lang="EN-GB" class="">Why are there negative results? I already saw this question in a previous discussion but I’m still not sure about the hundred percent correct answer.<o:p class=""></o:p></span></li></ol>
<div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class=""><o:p class=""> </o:p></span></div>
<ol start="2" type="1" style="margin-bottom: 0cm; margin-top: 0cm;" class="">
<li class="MsoListParagraph" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<span lang="EN-GB" class="">The results I get look rather strange at the first glance because there are a lot of consecutive One-values which seems unrealistic to me.<br class="">
Do you think my analysis has a mistake or the data is corrupted?<o:p class=""></o:p></span></li></ol>
<div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class="">Thank you very much for your help in advance and best regards<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" class="">Daniel<o:p class=""></o:p></span></div>
</div>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">fieldtrip
 mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="color: rgb(149, 79, 114); text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" style="color: rgb(149, 79, 114); text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://doi.org/10.1371/journal.pcbi.1002202</a></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>