<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Martin,<br>
      <br>
      that error most likely occurs because the rank of your datamatrix
      is not full. This can e.g. be the case for EEG data where you
      include the reference channel (or common average rereferenced) or
      when you used ft_channelrepair or, in your case, when you removed
      an ICA component, therefore reducing the rank of your data.<br>
      I am not sure what the best solution for this is, because there
      are several, e.g. you could do your MVar analysis on ICA data
      directly, do it on a subset of channels so that the datamatrix is
      rank sufficient again or just refrain from doing the mvar analysis.<br>
      <br>
      Best,<br>
      Jörn<br>
      <br>
      <br>
      On 4/22/2013 8:36 PM, Martin Winkels wrote:<br>
    </div>
    <blockquote
cite="mid:CAHDG_rUoTP-UA1Sy0opwLDuzT7OAAxssbsXx9pN5Ydw5Hbi_nQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hello Guys,<br>
        <div class="gmail_quote">
          <div dir="ltr">
            <div>
              <div><br>
              </div>
              <div>I am trying to perform connectivity analysis in
                sensor domain (fieldtrip and matlab are up to date).
                Within doing that I am facing a small problem in the ICA
                analysis in combination with a MVAR analysis. If I
                execute the following code, I get an error message as
                follows:<br>
                <br>
                <br>
              </div>
              Error using chol<br>
              Matrix must be positive definite.<br>
              <br>
              Error in armorf (line 40)<br>
              ap(:,:,1) = inv((chol(ap(:,:,1)/Nr*(Nl-1)))');<br>
              <br>
              Error in ft_mvaranalysis (line 390)<br>
                          [ar, tmpnoisecov] = armorf(dat,
              numel(rpt{rlop}), size(tmpdata.trial{1},2), cfg.order);<br>
              <br>
              Error in mu_firstexample (line 90)<br>
              mdata           = ft_mvaranalysis(cfg, data_ma_ica);<br>
               <br>
              <br>
            </div>
            Can anybody help me with that issue?<br>
            <div>
              <div><br>
                <div><br>
                  % artifact correction: ica component analysis <br>
                  <br>
                  cfg             = [];<br>
                  cfg.method      = 'runica'; <br>
                  cfg.runica.pca   = 40;<br>
                  comp            = ft_componentanalysis(cfg, data_ma);<br>
                  <br>
                  cfg             = [];<br>
                  cfg.layout      = 'CTF275.lay';<br>
                  cfg.viewmode    = 'component';<br>
                  ft_databrowser(cfg, comp)<br>
                  <br>
                  %% artifact correction: ica component rejection<br>
                  <br>
                  cfg             = [];<br>
                  cfg.component   = [4]; % to be removed component(s)<br>
                  data_ma_ica     = ft_rejectcomponent(cfg, comp,
                  data_ma);<br>
                  <br>
                  %% compute MVAR, spectral transfer and granger<br>
                  <br>
                  % mvar<br>
                  cfg             = [];<br>
                  cfg.order       = 5;<br>
                  cfg.toolbox     = 'bsmart';<br>
                  <br>
                  mdata           = ft_mvaranalysis(cfg, data_ma_ica);<br>
                  <br>
                  <br>
                </div>
                <div>Thank you,<br clear="all">
                </div>
                <div><br>
                  -- <br>
                  Martin Winkels<br>
                  <br>
                  B.Sc. / Ingenieur in
                  <div>
                    Medizininformatik und Biomedizintechnik
                    <div>
                      <br>
                      University of Münster<br>
                      <br>
                      phone: <a moz-do-not-send="true"
                        href="tel:%2B49%20177%206090603"
                        value="+491776090603" target="_blank">+49 177
                        6090603</a><br>
                      mail: <a moz-do-not-send="true"
                        href="mailto:m_wink10@uni-muenster.de"
                        target="_blank">m_wink10@uni-muenster.de</a></div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <br>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
fieldtrip mailing list
<a class="moz-txt-link-abbreviated" href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a>
<a class="moz-txt-link-freetext" href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Jörn M. Horschig
PhD Student
Donders Institute for Brain, Cognition and Behaviour 
Centre for Cognitive Neuroimaging
Radboud University Nijmegen 
Neuronal Oscillations Group
FieldTrip Development Team

P.O. Box 9101
NL-6500 HB Nijmegen
The Netherlands

Contact:
E-Mail: <a class="moz-txt-link-abbreviated" href="mailto:jm.horschig@donders.ru.nl">jm.horschig@donders.ru.nl</a>
Tel:    +31-(0)24-36-68493
Web: <a class="moz-txt-link-freetext" href="http://www.ru.nl/donders">http://www.ru.nl/donders</a>

Visiting address:
Trigon, room 2.30
Kapittelweg 29
NL-6525 EN Nijmegen
The Netherlands</pre>
  </body>
</html>