User:Peterz

Getting Bayesian: Priors and Posteriors
All parameters in DCM, such as connections between regions, have prior values (beliefs prior to seeing the data) and posterior values (estimated parameter values after seeing the data).

Priors
If you take a look at a DCM, you will find the priors in DCM.M.pE (prior mean of each parameter) and DCM.M.pC (prior covariance of each parameter). Whereas DCM.M.pE is simply laid out with matrices for A, B, C etc, DCM.M.pC is an nxn matrix, where n is the number of parameters. To make DCM.M.pC intelligible, you can convert this to the format with separate matrices for A,B,C etc. The code is as follows:

If you'd like to know the priors on each connection in the A-matrix, you can then simply do:

The priors for DCM are set by the script spm_dcm_fmri_priors.m. If you wish to change any of them, however, don't alter this script. Rather, set your new priors in DCM.options:

1. Bringing the number of free parameters to less than 16
Each iteration of the greedy search begins by listing the indices of A,B and C-matrix parameters with non-zero prior variance. The resulting list of parameters, k, are those which post-hoc DCM will switch on and off while searching the model space:

If there are more than 16 parameters, those with the least evidence are removed. To prepare for this, priors and posteriors of the parameters are collected into vectors - prior variables begin with 'p', posteriors begin with 'q'. Any parameters with zero prior covariance are removed from all these variables, performed by conducting an SVD on the prior covariance matrix:

The code then loops over each parameter in k (those with non-zero prior variance), and creates an updated prior variance vector with one parameter switched off, by having its variance set to zero. This is then used to generate a reduced prior covariance matrix (using the matrix U from the SVD above, rather than pc):

Armed with this reduced prior covariance matrix without the ith parameter, the full model can now be compared to the reduced model:

After repeating this for each parameter, only the 8 parameters in k which when removed give the strongest evidence are retained.

2. Searching all possible reduced models
Safe in the knowledge that the number of free parameters (listed in variable k) is not excessive, a list of all possible prior parameter vectors is generated, each with a different parameter switched off:

Models with each of these prior covariances are then evaluated, just as described above:

The results of the search across models are then collated (variable S). If models from multiple subjects are given, their log evidence (free energy) is pooled by adding the free energy of each. The evidence is then made relative to that of the full model (the last entry in S):

And converted to a posterior probability for each model:

If we started with more than 16 parameters, and if any parameters were removed, then all the steps described are repeated.

Conjunction
Conjunction analysis allows the experimenter to ask "do two or more conditions activate the same voxels"? You may find two different kinds of conjunction analysis used:


 * Global null. The null hypothesis is that all conditions are null in a given voxel. Therefore, a single condition having an effect would be sufficient to disprove the null hypothesis. This is implemented in SPM when pressing the 'global' button by taking the minimum of two statistical images.


 * Conjunction null Given two conditions, A and B, the conjunction null hypothesis is that there is no activation for condition A OR no activation for condition B. So to disprove it, both condition A and B would have to be show an effect.

GLM specification
The order of scripts for specifying a GLM is as follows: