<div dir="ltr">Hi Benjy,<div><br></div><div>I think components vs. back projected signals do not contain the exact same information. If you have your components, you can't just transform back to your original signals: The component time series themselves do not contain information regarding how much each of these components loads onto each of the original signals, which is what you need for computing the back projection. So the back projected signal combines these two pieces of information.</div><div><br></div><div>Likely your successful decoding also depends on this information, i.e., not just which PC components are present in the signal, but actually also the pattern across the original signals matters.</div><div><br></div><div>That's my guess, maybe somebody else has another idea? </div><div><br></div><div>Cheers,</div><div>Ingmar </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Op vr 8 sep 2023 om 16:04 schreef Barnett, Benjy via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div style="overflow-wrap: break-word;">
Hey everyone,
<div><br>
</div>
<div>I’m trying to work out why I am getting different decoding results using what I think to be rather equivalent pipelines.</div>
<div><br>
</div>
<div>I am currently try to decode trials from my dataset after removing the first principal component. However, I’m getting drastically different results depending on how I do the component removal.</div>
<div><br>
</div>
<div>If I follow what I imagine is the recommended method, I do this:</div>
<div><br>
</div>
<div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier;min-height:13px">
<br>
</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
    cfg = [];</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
    cfg.method = <span style="color:rgb(170,4,249)">'pca'</span>;</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
    cfg.updatesens = <span style="color:rgb(170,4,249)">'yes'</span>;</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
    comp = ft_componentanalysis(cfg, data);</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
    </div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
   %remove component</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
    cfg  = [];</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
    cfg.component = 1;</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
    data = ft_rejectcomponent(cfg,comp,data); %data to be decoded</div>
</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
<br>
</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
<br>
</div>
<div>However, I could instead just decode the components after removing the first, like this:</div>
<div><br>
</div>
<div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
    cfg = [];</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
    cfg.method = <span style="color:rgb(170,4,249)">'pca'</span>;</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
    cfg.updatesens = <span style="color:rgb(170,4,249)">'yes'</span>;</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
    comp = ft_componentanalysis(cfg, data);</div>
</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
<br>
</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
<div style="margin:0px;font-stretch:normal;line-height:normal">   %remove component</div>
</div>
<div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
    cfg = [];</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
    cfg.channel = comp.label(2:end);</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
    data = ft_selectdata(cfg,comp); %data to be decoded</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Courier">
<br>
</div>
</div>
<div><br>
</div>
<div>The first method (back projection) gives me results almost identical to that of the decoding of the full, original data - whereas the second method (decoding raw components) abolishes all successful decoding. </div>
<div><br>
</div>
<div>I’m not sure what the technical difference is here, because in my mind the information contained in both datasets (components vs. back projected) is the same, so I’m not sure why one abolishes decoding but the other does not. As such, I’m not
 sure which method is the correct one for my purposes of simply removing the first principal component prior to decoding.</div>
<div><br>
</div>
<div>I appreciate any guidance or help,</div>
<div>Benjy</div>
</div>

_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8KWnZwZN8Tdwovwcutxj69DnEjGA2wx0XF9LJCby411SAAeAslx7eP-2Be18OPo-CvuZxIj67D_Y7Nn2ztdymv_SW1KXNQ$" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="color:rgb(0,0,0);font-family:Tahoma,serif,EmojiFont;font-size:13px"><font style="font-family:Helvetica,serif,EmojiFont"><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</b></font></div><div style="color:rgb(0,0,0);font-family:Tahoma,serif,EmojiFont;font-size:13px"><font style="font-family:Helvetica,serif,EmojiFont"><b>Ingmar de Vries</b></font></div><div style="color:rgb(0,0,0);font-family:Tahoma,serif,EmojiFont;font-size:13px"><b><font style="font-family:Helvetica,serif,EmojiFont">Researcher @ Donders Institute, Radboud University, NL</font></b></div><div style="color:rgb(0,0,0);font-family:Tahoma,serif,EmojiFont;font-size:13px"><b><font style="font-family:Helvetica,serif,EmojiFont">& guest researcher @ CIMeC, University of Trento, IT</font></b><b><font style="font-family:Helvetica,serif,EmojiFont"><br></font></b></div><div style="color:rgb(0,0,0);font-family:Tahoma,serif,EmojiFont;font-size:13px"><div><div><font style="font-family:Helvetica,serif,EmojiFont"><b><a href="mailto:i.e.j.de.vries@gmail.com" target="_blank">i.e.j.de.vries@gmail.com</a></b></font></div><div><span style="font-family:Helvetica,serif,EmojiFont"><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br></b></span></div></div></div></div></div></div></div>