RAM use of freqstatistics

Michael Wibral wibral at BIC.UNI-FRANKFURT.DE
Tue Feb 17 11:16:00 CET 2009


Dear Listusers,

I have recently started to use freqstatistics with the cfg.correctm = 'cluster' option again and I am a bit puzzled by the amount of RAM it uses - but maybe that's normal. I just want to make sure I am not overlooking some stupid mistake.

Here is the code (it uses ~20GB per 1000 randomization draws, never got it to run through 5000+ iterations):

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PathName='/data/home1/wibral/Projects/HysteresisMEG/';
FileType='.mat';
AnalysisStr='TF_MTM_win125ms_fsm16p0Hz_Rel_';
PreprocStr='_0_cond_Preproc4LCMV_denoised_fmin0.5Hz_fmax200Hz_';

% contains the subject and date part of filename
Design={
'AEF29_HysteresisMEG_20080428';
'AKN13_HysteresisMEG_20080901';
'AZN28_HysteresisMEG_20080811';
'BAP07_HysteresisMEG_20090204';
'BRA29_HysteresisMEG_20080829';
'CHN03_HysteresisMEG_20080818';
'EKD25_HysteresisMEG_20080815';
'HZA25_HysteresisMEG_20080725';
'IWA05_HysteresisMEG_20080606';
'MBA11_HysteresisMEG_20080728';
'MTA07_HysteresisMEG_20090128';
'RRA18_HysteresisMEG_20080825';
'SKA29_HysteresisMEG_20090211';
'TSS07_HysteresisMEG_20080822';
};

for i=1:length(Design)
    fullname1=strcat(PathName,AnalysisStr,Design{i},PreprocStr, condNr1,FileType);
    load(fullname1); % a variable named TFdata or TFdataRel exists after this step
    data1{i}=TFdataRel; %
    clear TFdata; clear TFdataRel;

    fullname2=strcat(PathName,AnalysisStr,Design{i},PreprocStr, condNr2,FileType);
    load(fullname2); %a variable named TFdata or TFdataRel exists after this step
    data2{i}=TFdataRel; %
    clear TFdata; clear TFdataRel;
end;

cfg=[];
cfg.keepindividual='yes';
TFGA1 = freqgrandaverage(cfg,data1{:});
TFGA1.grad=data1{1}.grad; %get some gradiometer information for plotting
TFGA2 = freqgrandaverage(cfg,data2{:});
TFGA2.grad=data2{1}.grad; %get some gradiometer information for plotting

% do freqstatistics
cfg4stat=[];
cfg4stat.clusteralpha     = 0.05; % control admission to a cluster
cfg4stat.alpha            = 0.05; % control the false alarm rate of the permutation test
cfg4stat.avgovertime      = 'no';
cfg4stat.avgoverfreq      = 'no';
cfg4stat.avgoverchan      = 'no';
cfg4stat.statistic = 'depsamplesT'; % test statistic to evaluate the effect at the sample level
cfg4stat.numrandomization = (2^12); %
cfg4stat.correctm = 'cluster';
cfg4stat.method  = 'montecarlo';
cfg4stat.dimord = 'chan_freq_time';
cfg4stat.dim = 'chan_freq_time';
nSubjects = length(Design);
a = [1:nSubjects];
b = ones(1,nSubjects);
cfg4stat.design = [a a; b (2*b)];
cfg4stat.uvar = 1; % "subject" is unit of observation
cfg4stat.ivar = 2; % row of the design matrix that contains the independent variable

FreqStatResult = freqstatistics(cfg4stat,TFGA1,TFGA2)


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Michael Wibral.vcf
Type: text/x-vcard
Size: 344 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20090217/19242aeb/attachment.vcf>


More information about the fieldtrip mailing list