Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
workshop:meg-uk-2015:dcm_tutorial [2018/10/21 15:11]
42.49.180.224 [SPM DCM demo]
workshop:meg-uk-2015:dcm_tutorial [2017/08/17 11:21] (current)
127.0.0.1 external edit
Line 25: Line 25:
      * rSTS [51 -39 18]      * rSTS [51 -39 18]
   * As we are modelling a visual response, use a prior onset of sensory input at 70ms with a standard deviation of 16ms determining its duration. ​   * As we are modelling a visual response, use a prior onset of sensory input at 70ms with a standard deviation of 16ms determining its duration. ​
-  * Click the red arrow to continue. The data you’re working with should have a pre-specified head model (mapping from source-space to sensor-space). If the head model for this dataset hasn’t been computed, SPM will ask you to do it now. Let’s use the “template” model with a “normal” cortical mesh. To specify Nasion position, click “select” –&​gt; ​“nas” -&​gt; ​“OK”. Please do the same for LPA and RPA. Use headshape points. After a couple of minutes, click on “display MEG”, then use a “3-shell sphere” EEG head model and a “single shell” MEG head model and again click on “display MEG”. This completes the head model. ​+  * Click the red arrow to continue. The data you’re working with should have a pre-specified head model (mapping from source-space to sensor-space). If the head model for this dataset hasn’t been computed, SPM will ask you to do it now. Let’s use the “template” model with a “normal” cortical mesh. To specify Nasion position, click “select” –“nas” -“OK”. Please do the same for LPA and RPA. Use headshape points. After a couple of minutes, click on “display MEG”, then use a “3-shell sphere” EEG head model and a “single shell” MEG head model and again click on “display MEG”. This completes the head model. ​
   * You should now be able to define the neuronal model. We would like to compare several alternative models. However, depending on the number of sources, connections and effects to be modelled, the inversion of each model can take from several minutes up to a couple hours. For now let’s define a single model and save it. This is the model that we would like to define:   * You should now be able to define the neuronal model. We would like to compare several alternative models. However, depending on the number of sources, connections and effects to be modelled, the inversion of each model can take from several minutes up to a couple hours. For now let’s define a single model and save it. This is the model that we would like to define:
  
Line 32: Line 32:
   * In terms of the A (baseline connectivity),​ B (modulatory connectivity) and C (input) matrices, this model can be decomposed into the connections listed below. You can also turn to the last page of this instruction sheet to see if you have correctly defined the model.   * In terms of the A (baseline connectivity),​ B (modulatory connectivity) and C (input) matrices, this model can be decomposed into the connections listed below. You can also turn to the last page of this instruction sheet to see if you have correctly defined the model.
  
-&lt;code&gt;+<code>
 A{1} - Forward: A{1} - Forward:
-(3,1) rOFA -&​gt; ​rFFA +(3,1) rOFA -rFFA 
-(4,2) lOFA -&​gt; ​lFFA +(4,2) lOFA -lFFA 
-(5,1) rOFA -&​gt; ​rSTS +(5,1) rOFA -rSTS 
-(5,3) rFFA -&​gt; ​rSTS+(5,3) rFFA -rSTS
  
 A{2} - Backward: A{2} - Backward:
-(1,3) rFFA -&​gt; ​rOFA +(1,3) rFFA -rOFA 
-(2,4) lFFA -&​gt; ​lOFA +(2,4) lFFA -lOFA 
-(1,5) rSTS -&​gt; ​rOFA +(1,5) rSTS -rOFA 
-(3,5) rSTS -&​gt; ​rFFA+(3,5) rSTS -rFFA
  
 A{3} - Lateral: A{3} - Lateral:
-(2,1) rOFA -&​gt; ​lOFA +(2,1) rOFA -lOFA 
-(1,2) lOFA -&​gt; ​rOFA +(1,2) lOFA -rOFA 
-(4,3) rFFA -&​gt; ​lFFA +(4,3) rFFA -lFFA 
-(3,4) lFFA -&​gt; ​rFFA+(3,4) lFFA -rFFA
  
 B{1} – Modulatory: ​ B{1} – Modulatory: ​
-(3,1) rOFA -&​gt; ​rFFA +(3,1) rOFA -rFFA 
-(4,2) lOFA -&​gt; ​lFFA +(4,2) lOFA -lFFA 
-(5,1) rOFA -&​gt; ​rSTS +(5,1) rOFA -rSTS 
-(1,3) rFFA -&​gt; ​rOFA +(1,3) rFFA -rOFA 
-(2,4) lFFA -&​gt; ​lOFA +(2,4) lFFA -lOFA 
-(1,5) rSTS -&​gt; ​rOFA+(1,5) rSTS -rOFA
  
 C – Input: C – Input:
 (1) rOFA (1) rOFA
 (2) lOFA (2) lOFA
-&lt;/code&gt;+</code>
  
   * Finally, we do not impose constraints on dipolar symmetry, optimise source location, lock trial-specific effects or assume trial-specific inputs. You can ignore the wavelet options – these are used when modelling spectral responses (e.g. with CSD or IND models).   * Finally, we do not impose constraints on dipolar symmetry, optimise source location, lock trial-specific effects or assume trial-specific inputs. You can ignore the wavelet options – these are used when modelling spectral responses (e.g. with CSD or IND models).
   * You can now save this model definition as a file, e.g. as “DCM_inpO1F0_modF1B1”.   * You can now save this model definition as a file, e.g. as “DCM_inpO1F0_modF1B1”.
   * Now let’s modify this model by e.g. adding two more input connections to bilateral FFA and save it under another filename, e.g. as “DCM_inpO1F1_modF1B1”. Loading the previous model will restore the previously defined connectivity structure.   * Now let’s modify this model by e.g. adding two more input connections to bilateral FFA and save it under another filename, e.g. as “DCM_inpO1F1_modF1B1”. Loading the previous model will restore the previously defined connectivity structure.
-  * As model inversion can take some time (several minutes up to a couple hours), instead of inverting the model now you can find all inverted models in your folder ​&quot;Precalc_DCMs&quot;. Still, to see how model inversion looks like, you can now press “invert DCM”. This will – after some time – save the posterior parameter estimates and other statistics (crucially, the free-energy approximation to model evidence, which will be used to compare different models) in your DCM file. If you have already inverted some models, SPM will ask you if you would like to initialise the inversion with previous posteriors, priors or hyperpriors – usually you should answer “no”, unless you would like to e.g. user one subject’s posteriors as another subject’s priors. Then DCM will start to be estimated using an iterative model inversion technique called Variational Bayes. Usually the model inversion would converge (i.e., achieve the best model fit for the specified model structure) after several iterations. Below you can see an example of a window (updated with every iteration) showing the progress of model inversion. The panel at the top shows the estimated source activity for different neuronal sources and populations (separate lines) and experimental conditions (separate subplots). The middle panel shows the observed (dashed lines) and model-predicted (solid lines) responses for all experimental conditions (separate subplots), with different colours representing different spatiotemporal modes. The lower panels show updates in parameter space (left: neuronal parameters of the model; right: spatial parameters of the model). After each iteration, Matlab will also display the current update of the free-energy approximation to model evidence. If no convergence has been reached after 64 iterations, model inversion will stop automatically and save its current posterior parameter and model evidence estimates. You can press ctrl+c in Matlab to interrupt model inversion and load one of the already inverted models.+  * As model inversion can take some time (several minutes up to a couple hours), instead of inverting the model now you can find all inverted models in your folder ​"Precalc_DCMs". Still, to see how model inversion looks like, you can now press “invert DCM”. This will – after some time – save the posterior parameter estimates and other statistics (crucially, the free-energy approximation to model evidence, which will be used to compare different models) in your DCM file. If you have already inverted some models, SPM will ask you if you would like to initialise the inversion with previous posteriors, priors or hyperpriors – usually you should answer “no”, unless you would like to e.g. user one subject’s posteriors as another subject’s priors. Then DCM will start to be estimated using an iterative model inversion technique called Variational Bayes. Usually the model inversion would converge (i.e., achieve the best model fit for the specified model structure) after several iterations. Below you can see an example of a window (updated with every iteration) showing the progress of model inversion. The panel at the top shows the estimated source activity for different neuronal sources and populations (separate lines) and experimental conditions (separate subplots). The middle panel shows the observed (dashed lines) and model-predicted (solid lines) responses for all experimental conditions (separate subplots), with different colours representing different spatiotemporal modes. The lower panels show updates in parameter space (left: neuronal parameters of the model; right: spatial parameters of the model). After each iteration, Matlab will also display the current update of the free-energy approximation to model evidence. If no convergence has been reached after 64 iterations, model inversion will stop automatically and save its current posterior parameter and model evidence estimates. You can press ctrl+c in Matlab to interrupt model inversion and load one of the already inverted models.
  
 {{:​workshop:​meg-uk-2015:​image_inv.png?​400|}}\\ {{:​workshop:​meg-uk-2015:​image_inv.png?​400|}}\\
Line 86: Line 86:
 **Parameter inference** **Parameter inference**
  
-  * First, you can inspect a single model from a single participant using the GUI. To do this, in Matlab go to the &quot;pre-computed&​quot; ​directory, and in the GUI load one of Subject 15’s inverted models. Then use the drop-down menu in the lower left corner of the “DCM for M/EEG” window to view the results. For example, selecting “ERPs (mode)” will plot the observed (dashed lines) and model-predicted (solid lines) responses for all experimental conditions and spatiotemporal modes you have modelled. “ERPs (sources)” will plot the activity modelled for each neuronal source, including its different neuronal populations – in case of an ERP neuronal model, the solid lines will represent superficial pyramidal cells which contribute most strongly to the measured signals. Further options include e.g. “Coupling (B)” which will show you posterior estimates of modulatory connectivity parameters (the B matrix), and “trial-specific effects” (see below) which will show you connection strengths for different conditions (here 100% represents the connection strength for the baseline condition). Finally, “Response (image)” will show you the model fits across all modelled time points and sensors. This is the end of our demo.+  * First, you can inspect a single model from a single participant using the GUI. To do this, in Matlab go to the "pre-computed" ​directory, and in the GUI load one of Subject 15’s inverted models. Then use the drop-down menu in the lower left corner of the “DCM for M/EEG” window to view the results. For example, selecting “ERPs (mode)” will plot the observed (dashed lines) and model-predicted (solid lines) responses for all experimental conditions and spatiotemporal modes you have modelled. “ERPs (sources)” will plot the activity modelled for each neuronal source, including its different neuronal populations – in case of an ERP neuronal model, the solid lines will represent superficial pyramidal cells which contribute most strongly to the measured signals. Further options include e.g. “Coupling (B)” which will show you posterior estimates of modulatory connectivity parameters (the B matrix), and “trial-specific effects” (see below) which will show you connection strengths for different conditions (here 100% represents the connection strength for the baseline condition). Finally, “Response (image)” will show you the model fits across all modelled time points and sensors. This is the end of our demo.
  
 {{:​workshop:​meg-uk-2015:​image007.png?​400|}}\\ {{:​workshop:​meg-uk-2015:​image007.png?​400|}}\\