Dear Johannes,
> The out of memory error occurs with more than 140 Models.
> In principle the reason for the problem seems to be the same as if you
> run this line:
> test=rand(140,1e6);
> I would guess this results on most PCs in an out of memory error.
In this case, I would suggest that you change the default number of
samples used from 1e6 to 1e5 (variable Nsamp) - this shouldn't make any
significant difference in your results.
This function will be updated to have a better memory management.
Best regards,
Guillaume.
> -----Original Message-----
> From: SPM (Statistical Parametric Mapping) [mailto:[log in to unmask]]
> On Behalf Of Maria Joao
> Sent: Tuesday, April 21, 2009 8:09 PM
> To: [log in to unmask]
> Subject: Re: [SPM] 2 questions concerning BMS in spm8
>
> Dear Johannes,
>
> Thank you for spotting the error with the BMS.DCM.rfx.BF field.
> This field existed in SPM8b but has been replaced by BMS.DCM.rfx.SF.
> The visualisation routines for BMS for DCM have been corrected.
>
> Regarding your first question: I was wondering how many models you
> compared...
> I've used more than 20 models and haven't come across any memory problems.
>
> Best regards,
> Maria
>
>
>
> On Tue, Apr 21, 2009 at 4:54 PM, Johannes Tünnerhoff
> <[log in to unmask]> wrote:
>> Dear all,
>>
>> I have two questions concerning BMS in spm8:
>>
>>
>>
>> 1. There is an out of memory error when comparing (rfx) too many models in
>> spm_dirichlet_conj_exceed.m because the 'r-matrix' becomes too big.
>>
>> See line 37: r(:,k) = spm_gamrnd(alpha(k),1,Nsamp,1);
>>
>>
>>
>> I think I found a workaround:
>>
>> By saving the gamma distribution for each model alpha in a .mat-file,
>> the working memory cost can be lowered.
>>
>> Afterwards each mat-file is loaded when needed for comparison. This way it
>> takes longer, but the results don't seem to differ from the original
> script
>> (due to spm_gamrnd the results (xp) differ for every run slightly, so I
>> checked twice: first by using another function and second by comparing the
>> variation of the results) when comparing few models.
>>
>> Further details can be found in spm_dirichlet_conj_exceed_by_jotue.m
>> as attached.
>>
>>
>>
>> 2. When viewing the results of BMS using the matlabbatch I get an
> error: the
>> field BMS.DCM.rfx.BF does not exist.
>>
>> This is not the case if the results are displayed after estimation.
>>
>>
>>
>> When I replace BMS.DCM.rfx.BF with BMS.DCM.rfx.SF and BMS.DCM.ffx.BF with
>> BMS.DCM.ffx.SF in the file spm_run_bms_dcm_vis.m
>>
>> It seems to work.
>>
>>
>>
>> Did anyone else encounter these problems?
>>
>> Is my way to fix it correct?
>>
>>
>>
>> Thank you
>>
>> Johannes Tuennerhoff
>>
>>
>> -----------------------------------------------
>> Johannes Tünnerhoff
>> Max Planck Institute for Biological Cybernetics
>>
>> Cognitive Neuroimaging
>> Spemannstraße 41
>> 72076 Tübingen
>> Telephone: +49-7071-601 1785
>> Telefax: +49-7071-601 616
>>
>> Website: <http://www.kyb.mpg.de/~jotue> http://www.kyb.mpg.de/~jotue
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|