Dear Raphael
It is certainly possible to paste in your connectivity matrices from Excel to Matlab, if that's what you are most comfortable with. DCM.b is a 3D matrix, where the third dimension is the experimental condition. That's why, when you double click on it, you don't get an editable grid. So instead, just create a new variable in the Matlab workspace, e.g.
b = [];
Then you can double click on the name of the variable ('b') and paste in your matrix from Excel. Finally, copy 'b' it into the DCM structure with the code:
DCM.b(:,:,x) = b;
Where x is the number of the experimental condition. You can check the order of your experimental conditions by typing:
disp(char(DCM.U.name))
Note that if the DCM has previously been estimated, and you then change 'b' or the other connectivity matrices manually, you need to reset the model (clear out the old priors) before estimating it, using:
DCM = rmfield(DCM,'M');
You can then save the DCM variable in a file named 'DCM_name.mat' and estimate it in the usual way. Note, however, that there will be no paper trail for what you have done, reducing the reproducibility of your work. It would be better if you can write a Matlab script that loops over your candidate b matrices and reproduces the steps above. Perhaps you have someone in your lab with Matlab experience who can help you with the necessary coding.
Best
Peter
-----Original Message-----
From: SPM (Statistical Parametric Mapping) [mailto:[log in to unmask]] On Behalf Of Raphael Underwood
Sent: 14 December 2018 14:22
To: [log in to unmask]
Subject: [SPM] DCM automating/simplifying model specification
Hello All,
I am currently in the process of figuring out how to specify a large number of DCM models. I have 4 volumes of interest and 12 intrinsic connections (3 projections from each VOI), and I'm looking to specify several families of models (systematically varying modulatory connections from each VOI individually, then 'top down' and 'bottom-up' families that vary two VOIs at a time). The trial onsets are identical for each subject.
I'm nervous that specifying each model using the GUI will a. take a long time, and b. result in potential errors on my part mis-clicking buttons etc.
I have seen in the archives that others have kindly helped adapt or create scripts, although it seems these were to exhaustively vary the modulatory input, whereas I am creating specific families. Could there be a way of scripting what I'm looking for?
Alternatively I was wondering if I can specify one model, then open DCM.b in Matlab and manually paste in each B matrix that I've created in Excel (as a reference guide), saving as a new .mat file each time. My nervousness is that this is too simplistic and that it is not enough to vary the DCM.b variable only? Furthermore, I am considering including more than one input (Anger + Fear inputs), and when you do this Matlab doesn't open DCM.b as an editable grid (frustrating!).
Finally, I'm wondering if there is a way of batching the specification process in the batch editor, and if this is quicker? My searching around the forum and online has so far come back with nothing.
Any help or advice in simplifying the specification process would be greatly appreciated!
Kind regards,
Raphael
Dr. Raphael Underwood | Trainee Clinical Psychologist
Institute of Psychiatry, Psychology & Neuroscience King's College London Denmark Hill London
SE5 8AF
|