[FieldTrip] Different way of calculating the covariance for LCM

Jean-Michel Badier jean-michel.badier at univmed.fr
Thu Mar 24 22:06:03 CET 2011


Thanks all for your explanations,



Le 24/03/11 14:01, jan-mathijs schoffelen a écrit :
> Dear JM et al,
>
>>
>> see for example in version 20110222 ft_sourceanalysis from line 783
>>  elseif Ntrials>1
>>    % average the single-trial covariance matrices
>>    Cy  = reshape(mean(data.cov,1), [Nchans Nchans]);
>>    % select the average ERF
>>    avg = data.avg;
>>    Nrepetitions = 1;
>>
>> of course developers of fieldtrip would be the experts to comment on 
>> this.
>
> I am not sure what kind of comment you are looking for here. I think 
> the previous discussion with much appreciated contributions by Yuval 
> and Michael was quite conclusive.
>
> The difference between keeptrials='yes' and keeptrials='no' is that 
> the single replicates are kept in memory when keeptrials='yes' whereas 
> the covariance will be averaged (across the single trial covariances) 
> if you specify keeptrials='no'. The default behaviour of 
> sourceanalysis is to average across single replicate covariances 
> before computing the spatial filters. This is done to ensure a 
> relatively robust estimate of the covariance matrix. In general, 
> covariances estimated from single trials are just very noisy and don't 
> lead to good quality source reconstructions. 
It is clear.
Part of my misunderstanding comes from a very fast overview of the code 
and/or documentation and I did not realize that the option covariance = 
'yes' would be enough to calculate the covariance over the wholes trials 
and there is no need to specify keeptrials = 'yes'.
> In other words, if you would want to have a single trial estimate of 
> the reconstructed source time series, you still need to compute the 
> spatial filters based on a covariance averaged across multiple trials. 
> Once you have the spatial filter, you can project the single trial 
> sensor-level data through them.
>
> I believe this is most easily achieved by a 2-step procedure.
>
> tlck = ft_timelockanalysis(cfg, data); (with keeptrials = 'no')
>
>
> tlck2 = ft_timelockanalysis(cfg, data); (with keeptrials = 'yes')
>
> cfg = [];
> ...
> source = ft_sourceanalysis(cfg, tlck); (with keepfilters = 'yes')
>
> cfg.grid.filter = source.avg.filter;
> cfg.rawtrial = 'yes';
> source = ft_sourceanalysis(cfg, tlck2);
>
> This should (I think) give you the single trial time courses.
Ok it is an other step further
>
> But perhaps I am totally missing the point and this is not the 
> information you were looking for.
I do not think so.
Thanks again

Jean-Michel
>
> BW,
>
> JM
>
>
>
>
> Dr. J.M. (Jan-Mathijs) Schoffelen
> Donders Institute for Brain, Cognition and Behaviour,
> Centre for Cognitive Neuroimaging,
> Radboud University Nijmegen, The Netherlands
> J.Schoffelen at donders.ru.nl
> Telephone: 0031-24-3614793
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip


-- 

Jean-Michel Badier


Laboratoire de MagnétoEncéphaloGraphie

INSERM U751. Aix Marseille Université

33 (0)4 91 38 55 62

_jean-michel.badier at univmed.fr_ <mailto:jean-michel.badier at univmed.fr>


Service de Neurophysiologie Clinique. CHU Timone

264 Rue Saint-Pierre, 13005 Marseille-France



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20110324/5fd37888/attachment.html>


More information about the fieldtrip mailing list