Print

Print


Dear Freek
Thank you for sending me your files. The error is caused because ‘PEB’ is a cell array rather than a structure or a structure array i.e. you should be calling

BMA=spm_dcm_peb_bmc(PEB{1});

Instead of:

BMA=spm_dcm_peb_bmc(PEB(1));

I also notice that a field called ‘Pind’ is missing from your PEB file. If you receive a message that field PEB.Pind could not be found, I think you need to re-run spm_dcm_peb using the SPM version you mentioned (7487).

Best
Peter

From: Freek ten Doesschate <[log in to unmask]>
Sent: 03 January 2019 10:18
To: Zeidman, Peter <[log in to unmask]>
Cc: [log in to unmask]
Subject: Re: [SPM] Fwd: Between-subject effects in PEB model

Dear Peter,

Thanks for your response. I tried running the commands as you suggested and it runs fine untill step 8. Then I run into the same kind of error. Below I pasted the commands that I used and the errors that I encouter. I also attached the PEB model on which I try to run these commands.

I checked whether my SPM is up to date and this seems to be the case (version 7487).

Best,
Freek


When I run the 'BMA=spm_dcm_peb_bmc(PEB)’ command, I get:

>> BMA=spm_dcm_peb_bmc(PEB)
Error using spm_dcm_peb_bmc (line 102)
Please provide a single PEB model


So I also tried running it with only the first PEB model, like this:

>> BMA=spm_dcm_peb_bmc(PEB(1))
Dot indexing is not supported for variables of this type.

Error in spm_dcm_bmr_all (line 94)
if isstruct(DCM.M.pC), DCM.M.pC = diag(spm_vec(DCM.M.pC)); end

Error in spm_dcm_peb_bmc (line 111)
    [BMA,BMR,bma]  = spm_dcm_bmr_all(PEB);

Op wo 2 jan. 2019 om 12:37 schreef Zeidman, Peter <[log in to unmask]<mailto:[log in to unmask]>>:
Dear Freek


1. specify GLM for each subject

2. estimate GLM

3. specify a full DCM for each subject

4. estimate DCM

5. create a group DCM file (GCM)

6. run spm_dcm_fit on all models

7. run spm_dcm_bmr on the fitted models

8. run spm_dcm_peb on the reduced GCM file, including the design matrix with a mean regressor and the between group effect (1 for patients, 1 for healthy controls)

This mainly looks fine. Here are some minor corrections and clarifications:


1. specify GLM for each subject

2. estimate GLM

3. specify a full DCM for each subject

4. estimate DCM

5. create a group DCM file (GCM)

6. run spm_dcm_fit on all models

7. run spm_dcm_bmr on the fitted models (no need for this step)

87. run spm_dcm_peb on the reduced first column of the GCM file, which contains each subject’s full DCM. Include in the PEB design matrix a mean regressor and the between group effect (1 for patients, and minus 1 for healthy controls) which are then mean-centered, i.e.: X(:,2:end) = X(:,2:end) – mean(X(:,2:end));

8. run BMA=spm_dcm_peb_bmc(PEB) on the output of step 7.

9. Review the results using spm_dcm_peb_review(BMA);


Now the problem is, that I am not sure how to get to the between group difference in posterior probabilities from here.

See the extra step of launching the review window, above (the bar charts give you the effect sizes and probabilities).

I have tried a few things:


1.      review the PEB model from step 8. It gives an error saying: 'Please estimate this PEB model before reviewing’

That shouldn’t ever happen – it suggests that the input into the review function wasn’t a PEB model?


2.      run spm_dcm_peb_bmc on the output from step 8 ( BMA = spm_dcm_peb_bmc(PEB(1)) ). It gives an error saying: 'Dot indexing is not supported for variables of this type.’

The function is performing an automatic search over reduced models. It’s possible that all parameters were switched off during the search, which caused the error. To make sure there isn’t a more mundane explanation, please could you try updating to the latest SPM version and see if you still get this problem?


3.      not estimating the DCM in step 4. But then the bayesian model reduction gives an error.

Yes you did need to estimate them.


4.      in step 8, run spm_dcm_bmc_peb (instead of spm_dcm_peb) and then run spm_dcm_peb_bmc. This works fine when I got only the group mean as a regressor, however when I add the group difference as a regressor I get an error while running spm_dcm_bmc_peb. I attached the error in the ‘error_spm_dmc_bmc_peb.txt’ file and the script that I used in 'dcm_peb.m’.

This function does something different – it looks for the best mixture of first level models and second level covariates to explain the data. This doesn’t seem to be what you want at the moment.

Best
Peter