SPM2: Modelling and Inference
Will Penny
K. Friston, J. Ashburner, J.-B. Poline,
R. Henson, S. Kiebel, D. Glaser
Wellcome Department of Imaging Neuroscience,
University College London, UK
What’s new in SPM2 ?
Spatial transformation of images
Batch Mode
Modelling and Inference
SPM99
p <0.05
fMRI time-series
Kernel
Design matrix
Inference with Gaussian
field theory
Statistical parametric map (SPM)
Realignment
Smoothing
General linear model
Normalisation
Adjusted regional data
Template
Parameter estimates
spatial modes and
effective connectivity
What’s new in SPM2 ?
Spatial transformation of images
Batch Mode
Modelling and Inference
Expectation-Maximisation (EM)
Restricted Maximum
Likelihood (ReML)
Parametric Empirical
Bayes (PEB)
Hierarchical models
Hierarchical
model
y X (1) (1) (1)
(1) X ( 2) ( 2) ( 2)
Parametric
Empirical
Bayes (PEB)
( n 1) X ( n ) ( n ) ( n )
Single-level
model
y (1) X (1) (2) X (1) X (n1) (n) X (1) X (n) (n)
Restricted
Maximimum
Likelihood
(ReML)
Bayes Rule
Example 2:Univariate model
Likelihood and Prior
y ( 1 ) (1 )
(2)
( 2)
(1 )
p( y | ) N ( , )
(1)
(1)
(1)
p( (1)) N ( ( 2 ) , )
( 2)
Posterior
p ( (1) | y ) N (m(1) , P(1) )
P
(1)
(1)
(1)
m
P
( 2)
(1)
(1)
(1)
( 2)
m(1) (1)
( 2)
P
(1)
(2)
Relative Precision Weighting
Example 2:Multivariate two-level model
Data-determined parameters
Likelihood and Prior
Assume
diagonal
precisions
y X (1) (1) (1)
(1)
( 2)
( 2) ( 2)
X
ri
i
p( y | ) N ( X , I )
(1)
(1)
(1)
(1)
eigi [ P(1) ]
ri
ri
(2)
p( (1)) N ( X ( 2 ) ( 2 ) , I )
( 2)
Posterior
p ( (1) | y ) N (m(1) , P(1) )
(1)
(1) 1
P (X
X ) I
(1)
m P
(1)
(1)
(1) 1
T
(1)
X
( 2)
(1) T
y
Precisions
Assume
Shrinkage 1
1
(1) (1)
||
y
||
X
Prior
(1)
T
( 2)
0
1 1 (1)
|| m ||
(2)
General Case: Arbitrary error covariances
Covariance constraints
y X (1) (1) (1)
(1)
X
( 2)
( 2)
( 2)
C(1)
1(1)Q1(1)
(21)Q2(1)
C( 2 )
1( 2)Q1( 2 )
(22 )Q2( 2 )
(31)Q3(1)
( n 1) X ( n ) ( n ) ( n )
C(1)
C
0
(32 )Q3( 2 )
0
General Case
EM algorithm
y X (1) (1) (1)
E-Step
(1) X ( 2) ( 2) ( 2)
M-Step
( n 1)
X
(n)
C
y
(X T C 1 X
h
y
C X T C 1 y
y
r y Xh
)
1
y
for i and j {
(n)
(n)
g i tr {Q i C 1 } r T C 1Q i C 1 r tr {C X T C 1Q i C 1 X }
y
J ij tr {Q j C 1Q i C 1 }
}
J 1 g
C C
k
Qk
Friston, K. et al. (2002), Neuroimage
Pooling assumption
Decompose error covariance at each voxel, i, into
a voxel specific term, r(i), and voxel-wide terms.
C (i ) r (i )[ Q Q Q ...]
1
1
2
2
3
3
What’s new in SPM2 ?
Corrections for Non-Sphericity
Posterior Probability Maps (PPMs)
Haemodynamic modelling
Dynamic Causal Modelling (DCM)
Non-sphericity
Relax assumption that errors are Independent
and Identically Distributed (IID)
Non-independent errors eg. repeated measures
within subject
Non-identical errors eg. unequal
condition/subject error variances
Correlation in fMRI time series
Allows multiple parameters at 2nd level ie. RFX
Single-subject contrasts
from Group FFX
PET Verbal Fluency
SPMs,p<0.001
uncorrected
Non-identical
error variances
Sphericity
Non-sphericity
Correlation in fMRI time series
Model errors for each subject
as AR(1) + white noise.
The Interface
OLS
Parameters,
REML
Hyperparameters
PEB
Parameters
and
Hyperparameters
No Priors
Shrinkage
priors
Bayesian estimation: Two-level model
1st level = within-voxel
y X (1) (1) (1)
(1)
( 2)
( 2) ( 2)
X
2nd level = between-voxels
Likelihood
Shrinkage Prior
Bayesian Inference: Posterior Probability Maps
p( | y ) p( y | ) p( )
PPMs
Posterior
Likelihood
Prior
SPMs
u
p (t | 0)
p ( | y )
t f ( y)
SPMs and PPMs
rest [2.06]
rest
contrast(s)
<
PPM 2.06
SPMresults: C:\home\spm\analysis_PET
Height threshold P = 0.95
Extent threshold k = 0 voxels
SPMmip
[0, 0, 0]
<
1
4
7
10
13
16
19
22
25
28
31
34
37
40
43
46
49
52
55
60
<
SPM{T39.0}
SPMresults: C:\home\spm\analysis_PET
Height threshold T = 5.50
Extent threshold k = 0 voxels
1 4 7 10 13 16 19 22
Design matrix
3
<
4
<
SPMmip
[0, 0, 0]
<
contrast(s)
1
4
7
10
13
16
19
22
25
28
31
34
37
40
43
46
49
52
55
60
1 4 7 10 13 16 19 22
Design matrix
Sensitivity
motion [0.40]
motion
<
PPM 0.40
SPMresults: C:\home\spm\analysis_set
Height threshold P = 0.50
Extent threshold k = 0 voxels
<
1
16
31
46
61
76
91
106
121
136
151
166
181
196
211
226
241
256
271
286
301
316
331
360
<
SPMmip
[0, 0, 0]
7
<
SPMmip
[0, 0, 0]
<
contrast(s)
<
SPM{T247.7}
SPMresults: C:\home\spm\analysis_set
Height threshold T = 4.88
Extent threshold k = 0 voxels
1
2
3 4 5 6
Design matrix
7
9
contrast(s)
1
16
31
46
61
76
91
106
121
136
151
166
181
196
211
226
241
256
271
286
301
316
331
360
1
0.8
0.6
0.4
10
8
6
4
0.2
2
0
0
1
2
3 4 5 6
Design matrix
7
Simulated data
Spatio-temporal
modelling of PET
data
Real data (Word fluency)
The hemodynamic model
f in 1
f
u
signal
s
s
u(t)
s
s
0
volume
f in
activity
f out v,
flow
0
fin
f in E f in , E0
0 E0
v
f out v,
0
q
v
BOLD signal
y (t ) (v, q, E0 )
dHb
q
State Equations
Flow component
Balloon component
Activity-dependent signal
The rate of change of volume
s u (t ) s/ s ( f in 1) / f
0 v f in f out (v, )
Flow inducing signal
fin s
The change in deoxyhemoglobin
0 q f in
E ( f in , E 0 )
f out (v, )q / v
E0
Output function: a mixture of intra- and extra-vascular signal
y (t ) (v, q, E0 ) V0 (k1 (1 q ) k 2 (1 q / v) k3 (1 v) )
Hemodynamics
Inference with MISO models
s 1u1 (t ) J u J (t ) s/ s ( f in 1) / f
fMRI study of attention to visual
motion
Dynamical Causal Models
Functional integration and the modulation of specific pathways
Cognitive set - u2(t)
{e.g. semantic processing}
BA39
Stimuli - u1(t)
{e.g. visual words}
STG
V4
BA37
V1
Extension to a MIMO system
neuronal
changes
Input
u(t)
b23
c1
intrinsic
connectivity
induced
connectivity
induced
response
x1 a11 a n1
b11 bn1 x1 c1
u u
x n a1n a nn
b1n bnn x n c n
The bilinear model
a12
activity
x1(t)
hemodynamics
X f ( X , u(t ))
response
y(t)=(X)
x ( A u j B j ) x C j u j
activity
x2(t)
j
activity
x3(t)
hemodynamics
X f ( X , u(t ))hemodynamics
X f ( X , u(t ))
response
y(t)=(X)
j
response
y(t)=(X)
{ A, B, C}
y (t ) h(u (t ))
Hemodynamic model
Dynamical systems theory
X ' (t ) AX ' BX ' u
Inputs u(t)
0
A f ( X ,0) f ( X 0 ,0) X
0
0
X
0
2
B f ( X 0 ,0) f ( X 0 ,0) X
0
u
Xu
0
f ( X 0 ,0)
X
0
2 f ( X 0 ,0)
Xu
Connections
{A,B,C}
X ' (t i 1 ) e ti ( A Bu (ti )) X ' (t i )
y(t i 1 ) ( X (t i 1 ))
Outputs y(t)
EM algorithm
r y h(u (t ), h( ny) )
Kernels
()
J h(u (t ), h( ny) )
C ( n )V
Connectivity
constraints C
(
C y J T C1 J C1
)
1
E-Step
h( ny1) h( ny) C y ( J T C1 r C1 (h h( ny) ))
( n 1) r T V 1 r / m tr{C | y J T V 1 J } / m
M-Step
Bayesian Inference
Inference
p() >
© Copyright 2026 Paperzz