<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 Maxime,
<div class=""><br class="">
</div>
<div class="">Another version of this question has been asked on this discussion list before: <a href="https://mailman.science.ru.nl/pipermail/fieldtrip/2019-July/039322.html" class="">https://mailman.science.ru.nl/pipermail/fieldtrip/2019-July/039322.html</a></div>
<div class="">I suggest that you read this thread first, and act according to the recommendations.</div>
<div class=""><br class="">
</div>
<div class="">Please don’t hesitate to ask follow up questions, or if things are not clear, on this current thread.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 1 Sep 2020, at 12:52, Maxime Fauvet <<a href="mailto:maxime.fauvet@inserm.fr" class="">maxime.fauvet@inserm.fr</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">
<p class="">Hello everyone,</p>
<p class="">I am Maxime Fauvet from ToNIC lab in Toulouse, France, currently working on functional connectivity between brain and muscles during movement through corticomuscular coherence analyses of EEG and EMG signals. I am trying to perform a granger causality
 (GC) analysis from those signals but somehow I cannot achieve to get a complete time-frequency map of the GC.</p>
<p class="">I used ft_freqanalysis with the following raw data and cfg:</p>
<p class="">cfg.method: ‘wavelet’<br class="">
cfg.output: ‘powandcsq’<br class="">
cfg.foi: 1:1:50<br class="">
cfg.pad: 1000</p>
<p class="">raw data: 2 matrices of 17 trials and 3 seconds sampled at 1KHz, one for EEG and the other for EMG signals, structured as required in ft_freqanalysis</p>
<p class="">After removing NaNs from powerspectrum and crosspowerspectrum, and setting cfg.method: ‘granger’, I used ft_connectivityanalysis with the cfg and freq (issued from ft_freqanalysis) arguments.</p>
<p class="">However, I receive the following warning message many times:</p>
<p class="">Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. <br class="">
>In sfactorization_wilson (line 187)<br class="">
  In ft_connectivity_csd2tranfer (line 267)<br class="">
  In ft_connectivityanalyis (line 464)</p>
<p class="">The issue appears to come from the matrix factorization function and more precisely from the chol function, a Matlab core function. Interestingly, some points of the time series do not trigger the warning message.</p>
<p class="">Can someone tell me if anything is wrong with the use of ft_connectivityanalysis (either in cfg or data)? Any help would be appreciated.</p>
<p class="">Best wishes,</p>
<p class="">Maxime</p>
<div class=""> <br class="webkit-block-placeholder">
</div>
<div class=""> </div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>