<div dir="ltr">Hello Alexander, <div><br></div><div>Thank you for your feedback. So is it safe to say that the final data present in the covariance matrix (MxM where M is the number of channels) is the average of the covariance matrices over multiple trials? </div><div><br></div><div>Regards,</div><div><br></div><div>Soujata. <br><br><br><br><div class="mt-signature"><font color="#999999" class="mt-signature-text">Sent with <a href="https://mailtrack.io/install?source=signature&lang=en&referral=s.borbaruah@student.utwente.nl&idSignature=22" class="mt-install">MailTrack</a></font></div></div><img width="0" height="0" class="mailtrack-img" src="https://mailtrack.io/trace/mail/8911b611a658d117cc343620fdd0fd964cb25155741513.png"></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 16, 2016 at 5:00 PM, Nakhnikian, Alexander <span dir="ltr"><<a href="mailto:Alexander_Nakhnikian@hms.harvard.edu" target="_blank">Alexander_Nakhnikian@hms.harvard.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi Soujatta,</p>
<p><br>
</p>
<p>I hope I understand your question.</p>
<p><br>
</p>
<p>For demeaned data, the covariance is the expected value of sum(xy). For data with finite mean, we have to get the expected value of sum(x-mu(x))*sum(y-mu(y)). Removing the mean and trend doesn't have any impact on the denominators used to compute the unbiased
estimate of E{sum(xy)}. The unbiased covariance estimated between x and y for a given trial is sum(xy)/(N_times-1), where N _times is the number of time points in an epoch. When averaging covariance matrices over multiple trials the denominator becomes N_trs-1.
I hope that helps.</p>
<p><br>
</p>
<p>Best,</p>
<p><br>
</p>
<p>Alexander </p>
</div>
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> <a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank">fieldtrip-bounces@science.ru.nl</a> <<a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank">fieldtrip-bounces@science.ru.nl</a>> on behalf of Soujata Borbaruah <<a href="mailto:s.borbaruah@student.utwente.nl" target="_blank">s.borbaruah@student.utwente.nl</a>><br>
<b>Sent:</b> Thursday, June 16, 2016 10:19:12 AM<br>
<b>To:</b> fieldtrip, donders<br>
<b>Subject:</b> [FieldTrip] What is the data present in the covariance matrix after using ft_timelockanalysis</font>
<div> </div>
</div><div><div class="h5">
<div>
<div dir="ltr">Hello,
<div><br>
</div>
<div>I want to calculate the covariance of the data I provide. In the function ft_timelockanalysis there is a portion where the covariance is being normalised over all trials by the total number of samples in all trials. </div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>% normalize the covariance over all trials by the total number of samples in all trials</div>
<div>if strcmp(cfg.covariance, 'yes')</div>
<div> if strcmp(cfg.keeptrials,'yes')</div>
<div> for i=1:ntrial</div>
<div> if strcmp(cfg.removemean, 'yes')</div>
<div> covsig(i,:,:) = covsig(i,:,:) / (numcovsigsamples(i)-1);</div>
<div> else<br>
</div>
<div> covsig(i,:,:) = covsig(i,:,:) / numcovsigsamples(i);</div>
<div> end<br>
</div>
<div> end</div>
<div> else</div>
<div> if strcmp(cfg.removemean, 'yes')</div>
<div> covsig = squeeze(nansum(covsig, 1)) / (sum(numcovsigsamples)-ntrial);</div>
<div> else<br>
</div>
<div> covsig = squeeze(nansum(covsig, 1)) / sum(numcovsigsamples);</div>
<div><br>
</div>
<div> end</div>
<div> end</div>
<div>end</div>
</div>
<div><br>
</div>
<div>Please note that the cfg.removemean was selected as yes. </div>
<div><br>
</div>
<div>Can someone please explain what is the final data present in my covariance matrix? <br>
<br>
<br>
<br>
<div><font color="#999999">Sent with <a href="https://mailtrack.io/install?source=signature&lang=en&referral=s.borbaruah@student.utwente.nl&idSignature=22" target="_blank">
MailTrack</a></font></div>
</div>
<img width="0" height="0" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"></div>
</div>
</div></div></div>
<br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><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></blockquote></div><br></div>