Bayesian inference Lee Harrison York Neuroimaging Centre 01 / 05 / 2009.
-
Upload
leah-maynard -
Category
Documents
-
view
218 -
download
4
Transcript of Bayesian inference Lee Harrison York Neuroimaging Centre 01 / 05 / 2009.
Bayesian inference
Lee Harrison
York Neuroimaging Centre
01 / 05 / 2009
Overview
• Probabilistic modeling and representation of uncertainty– Introduction
– Curve fitting without Bayes
– Bayesian paradigm
– Hierarchical models
• Variational methods (EM, VB)
• SPM applications– fMRI time series analysis with spatial priors
– EEG source reconstruction
– Dynamic causal modelling
Overview
• Probabilistic modeling and representation of uncertainty– Introduction
– Curve fitting without Bayes
– Bayesian paradigm
– Hierarchical models
• Variational methods (EM, VB)
• SPM applications– fMRI time series analysis with spatial priors
– EEG source reconstruction
– Dynamic causal modelling
Generation
Recognition
Introduction
time
Overview
• Probabilistic modeling and representation of uncertainty– Introduction
– Curve fitting without Bayes
– Bayesian paradigm
– Hierarchical models
• Variational methods (EM, VB)
• SPM applications– fMRI time series analysis with spatial priors
– EEG source reconstruction
– Dynamic causal modelling
Curve fitting without BayesData Ordinary least squares
yZZZE
ZyZyE
Zxfy
TTols
D
TD
1)(ˆ0
)()(
)(
y
Curve fitting without BayesData Ordinary least squares
y Z
Curve fitting without BayesOrdinary least squares
Z
Bases (explanatory variables) Sum of squared errors
y
Data and model fit
Bases (explanatory variables) Sum of squared errors
Curve fitting without BayesData and model fit Ordinary least squares
Bases (explanatory variables) Sum of squared errors
y Z
Curve fitting without BayesData and model fit Ordinary least squares
Bases (explanatory variables) Sum of squared errors
y Z
Curve fitting without BayesData and model fit
Bases (explanatory variables) Sum of squared errors
y
Over-fitting: model fits noise
Inadequate cost function: blind to overly complex models
Solution: incorporate uncertainty in model parameters
Ordinary least squares
Overview
• Probabilistic modeling and representation of uncertainty– Introduction
– Curve fitting without Bayes
– Bayesian paradigm
– Hierarchical models
• Variational methods (EM, VB)
• SPM applications– fMRI time series analysis with spatial priors
– EEG source reconstruction
– Dynamic causal modelling
Bayesian Paradigm:priors and likelihood
eZy Model:
Z
Bayesian Paradigm:priors and likelihood
1
2
eZy Model:
Prior:
)2/exp(
),0()(
2
122
T
kk INp
Sample curves from prior (before observing any data)
Mean curve
x
Z
Bayesian Paradigm:priors and likelihood
1
2
eZy Model:
Prior:
)2/exp(
),0()(
2
122
T
kk INp
1
2
Bayesian Paradigm:priors and likelihood
1
2
)2/)(exp(
),(),(
),|(),(
21
111
1
111
ii
ii
N
ii
Zy
ZNyp
ypyp
eZy Model:
Prior:
)2/exp(
),0()(
2
122
T
kk INp
Likelihood:
x
Z
Bayesian Paradigm:priors and likelihood
1
2
eZy Model:
Prior:
)2/exp(
),0()(
2
122
T
kk INp
Likelihood:
)2/)(exp(
),(),(
),|(),(
21
111
1
111
ii
ii
N
ii
Zy
ZNyp
ypyp
x
Z
Bayesian Paradigm:priors and likelihood
1
2
eZy Model:
Prior:
)2/exp(
),0()(
2
122
T
kk INp
Likelihood:
)2/)(exp(
),(),(
),|(),(
21
111
1
111
ii
ii
N
ii
Zy
ZNyp
ypyp
x
Z
Bayesian Paradigm: posterior
yCZ
IZZC
CNyp
T
kT
1
1
21
, ,|
x
Z
eZy Model:
Prior:
)2/exp(
),0()(
2
122
T
kk INp
Likelihood:
Bayes Rule:
)|(),|(),( pypyp
Posterior:
N
iiypyp
111 ),|(),(
1
2
Bayesian Paradigm: posterior
1
2
x
Z
yCZ
IZZC
CNyp
T
kT
1
1
21
, ,|
eZy Model:
Prior:
)2/exp(
),0()(
2
122
T
kk INp
Likelihood:
Bayes Rule:
)|(),|(),( pypyp
Posterior:
N
iiypyp
111 ),|(),(
Bayesian Paradigm: posterior
1
2
x
Z
yCZ
IZZC
CNyp
T
kT
1
1
21
, ,|
eZy Model:
Prior:
)2/exp(
),0()(
2
122
T
kk INp
Likelihood:
Bayes Rule:
)|(),|(),( pypyp
Posterior:
N
iiypyp
111 ),|(),(
Bayesian Paradigm:model selection
|log myp
2
olsZy
Cos
t fu
nct
ion
Bayes Rule:
)(
)|(),|(),(
myp
mpmypmyp
normalizing constant
dmpmypmyp )|(),|()(
)()(
)|(log
mcomplexitymaccuracy
myp
Model evidence:
constkmcomplexity
constZymaccuracy
2
21
2
2
1
log)(
)(
Overview
• Probabilistic modeling and representation of uncertainty– Introduction
– Curve fitting without Bayes
– Bayesian paradigm
– Hierarchical models
• Variational methods (EM, VB)
• SPM applications– fMRI time series analysis with spatial priors
– EEG source reconstruction
– Dynamic causal modelling
y
1
2
1
2
3
)|(),|(),,|(),,|(
)|,(
3222111 mpmpmpmyp
myp
Hierarchical models
111
2221
1332 ),0(~
eZy
eZ
Ne
recognition
y
time
space
1
space
2
generation
?)(q
Overview
• Probabilistic modeling and representation of uncertainty– Introduction
– Curve fitting without Bayes
– Bayesian paradigm
– Hierarchical models
• Variational methods (EM, VB)
• SPM applications– fMRI time series analysis with spatial priors
– EEG source reconstruction
– Dynamic causal modelling
Variational methods:approximate inference
)(
)|,(),|(
myp
mypmyp
True posterior
Initial guess and iteratively improve to approximate true posterior
KLFL
myp
q
mypq
q
q
myp
mypq
myp
mypmyp
),|(
)(log)(
)(
)|,(log)(
)(
)(
),|(
)|,(log)(
),|(
)|,(log)(log L
F
KL
fixed
Can computeMaximize minimize KL
Difference btw approx. and true posteriorBut cannot compute as do not know
But how?
)()( ii
))|(|)((),|(log
)(
)|,(log)(
)(mpqKLmyp
q
mypqF
q
Variational methods:approximate inference
accuracy complexity
iii dmypqI \\ )|,(log)(
ii
ii
dI
Iq
)(exp
)(exp
If you assume posterior factorises
then F can be maximised by letting
where
)()( ii
Overview
• Probabilistic modeling and representation of uncertainty– Introduction
– Curve fitting without Bayes
– Bayesian paradigm
– Hierarchical models
• Variational methods (EM, VB)
• SPM applications– fMRI time series analysis with spatial priors
– EEG source reconstruction
– Dynamic causal modelling
AR coeff(correlated noise)
prior precisionof AR coeff
A
VB estimate of WML estimate of W
aMRI smoothed W (RFT)
fMRI time series analysis with spatial priors
observations
GLM coeff
prior precisionof GLM coeff
prior precisionof data noise
Y
W
Penny et al 2005
11,0 LNWp
degree of smoothness Spatial precision matrix
AR coeff(correlated noise)
prior precisionof AR coeff
A
VB estimate of WML estimate of W
aMRI smoothed W (RFT)
)( nwq )( mwq
nwmw
fMRI time series analysis with spatial priors
observations
GLM coeff
prior precisionof GLM coeff
prior precisionof data noise
Y
W
Penny et al 2005
Mean (Cbeta_*.img)
Std dev (SDbeta_*.img)
PPM (spmP_*.img)
)( thsWqp
activation threshold
ths
Posterior density q(wn)
Probability mass pn
fMRI time series analysis with spatial priors:posterior probability maps
probability of getting an effect, given the dataprobability of getting an effect, given the data
),()( nnn Nwq mean: size of effectcovariance: uncertainty
thpp
Display only voxels that exceed e.g. 95%Display only voxels that exceed e.g. 95%
fMRI time series analysis with spatial priors:single subject - auditory dataset
0
2
4
6
8
0
50
100
150
200
250
Active > Rest Active != Rest
Overlay of effect sizes at voxels where SPM is 99% sure that the
effect size is greater than 2% of the global mean
Overlay of 2 statistics: This shows voxels where the activation is different
between active and rest conditions, whether positive or negative
|log myp
2
olsZy
fMRI time series analysis with spatial priors:group data – Bayesian model selection
)()(log qFmyp
Compute log-evidence for each model/subjectCompute log-evidence for each model/subject
model 1model 1
model Kmodel K
subject 1subject 1
subject Nsubject N
Log-evidence mapsLog-evidence maps
fMRI time series analysis with spatial priors:group data – Bayesian model selection
kr
k
BMS mapsBMS maps
PPMPPM
EPMEPM
model kmodel kJoao et al, 2009 (submitted)
)()(log qFmyp
Compute log-evidence for each model/subjectCompute log-evidence for each model/subject
model 1model 1
model Kmodel K
subject 1subject 1
subject Nsubject N
Log-evidence mapsLog-evidence maps
)( krq
kr
941.0)5.0( krq
Probability that model k generated data
Probability that model k generated data
Overview
• Probabilistic modeling and representation of uncertainty– Introduction
– Curve fitting without Bayes
– Bayesian paradigm
– Hierarchical models
• Variational methods (EM, VB)
• SPM applications– fMRI time series analysis with spatial priors
– EEG source reconstruction
– Dynamic causal modelling
DistributedSource model
K
J
MEG/EEG Source Reconstruction
KJy
Forward model(generation)
Inversion(recognition)
- under-determined system- priors required
Mattout et al, 2006
[nxt] [nxp] [nxt][pxt]
n : number of sensorsp : number of dipolest : number of time samples
Overview
• Probabilistic modeling and representation of uncertainty– Introduction
– Curve fitting without Bayes
– Bayesian paradigm
– Hierarchical models
• Variational methods (EM, VB)
• SPM applications– fMRI time series analysis with spatial priors
– EEG source reconstruction
– Dynamic causal modelling
),,( uxFx Neural state equation:
Electric/magneticforward model:
neural activityEEGMEGLFP
Neural model:1 state variable per regionbilinear state equationno propagation delays
Neural model:8 state variables per region
nonlinear state equationpropagation delays
fMRI ERPs
inputs
Hemodynamicforward model:neural activityBOLD
Dynamic Causal Modelling:generative model for fMRI and ERPs
Thank-you