<div dir="ltr">Hi again,<br><br>Just to clarify the above, here is the code that I use to calculate the AIC:<br>"source" is my inverse-solution after being partitioned into virtual channels using the AAL atlas.<div><br></div><div>% mvar analysis.<div> cfg = [];</div><div> cfg.order = order;</div><div> cfg.toolbox = 'bsmart';</div><div> mdata = ft_mvaranalysis(cfg, source); </div><div> </div><div> % aic calculation: <a href="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/">www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/</a></div><div> k = size(source.label,1);</div><div> p = cfg.order;</div><div> logv = log(det(mdata.noisecov)); % this gives me inf, as det(mdata.noisecov) is 0.<br><br></div><div> % look at source </div><div> nTotal = size(source.time,2)*length(source.time{1}); </div><div> aic = -logv + 2*p*(k^2)/nTotal; </div><div> disp(strcat(['order:' num2str(order) ', aic:',num2str(aic)]));</div></div><div><br></div><div>Any ideas would be greatly appreciated!</div><div>Best,</div><div><br></div><div>Nitzan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 26, 2014 at 9:24 PM, Nitzan Uziely <span dir="ltr"><<a href="mailto:linkgoron@gmail.com" target="_blank">linkgoron@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">Hi,<br><br>My name is Nitzan Uziely, and I'm a student (under-grad) at the Hebrew University of Jerusalem.<br><br>I'm using fieldtrip to process EEG signals at our lab, and I'm trying to run a PDC analysis on my data. <div><br>I took the data, calculated the inverse-solution and segmented it into virtual channels using the AAL atlas.<br><br>I'm trying to to calculate the correct order for the ft_mvaranalysis function.<br>I've seen a previous question that went unanswered a few years ago about order selection (<a href="http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003947.html" target="_blank">http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003947.html</a>).<br><br>Following the above question, I searched how to calculate the Akaike Information Criterion (AIC) to calculate the correct model order. According to <a href="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/" target="_blank">http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/</a> I need to calculate the determinant of the noise covariance matrix, however the determinant (I've checked orders 1 to 10) is so small that matlab just rounds it to zero. This makes me feel that either I have a problem, I've misunderstood how to calculate AIC to select the correct model, or that AIC is not the correct way to go.<br><br>So, my question is - does it seem that is something wrong with my data (which can be seen by the small determinant), am I misunderstanding the requirement of the determinant or is there a better way to select the order of the mvar model. (oh, I'm using mdcfg.toolbox = 'bsmart'; if it matters)<br><br>Thanks,<br><br>Nitzan.<br></div></div></div></div>
</div></div></blockquote></div><br></div>