# Slide 1 Wellcome Trust Centre for Neuroimaging UCL (PowerPoint)

Document Sample

```					Bayesian Inference

Will Penny

Wellcome Centre for Neuroimaging, UCL, UK.

SPM for fMRI Course,
London, October 21st, 2010
What is Bayesian Inference ?

(From Daniel Wolpert)
Bayesian segmentation
and normalisation

realignment      smoothing        general linear model

statistical       Gaussian
inference        field theory
normalisation
p <0.05

template
Bayesian segmentation         Smoothness
and normalisation            modelling

realignment      smoothing        general linear model

statistical       Gaussian
inference        field theory
normalisation
p <0.05

template
Bayesian segmentation         Smoothness         Posterior probability
and normalisation            estimation          maps (PPMs)

realignment      smoothing         general linear model

statistical         Gaussian
inference          field theory
normalisation
p <0.05

template
Bayesian segmentation         Smoothness         Posterior probability        Dynamic Causal
and normalisation            estimation          maps (PPMs)                  Modelling

realignment      smoothing         general linear model

statistical         Gaussian
inference          field theory
normalisation
p <0.05

template
Overview

• Parameter Inference
– GLMs, PPMs, DCMs

• Model Inference
– Model Evidence, Bayes factors (cf. p-values)

• Model Estimation
– Variational Bayes

• Groups of subjects
– RFX model inference, PPM model inference
Overview

• Parameter Inference
– GLMs, PPMs, DCMs

• Model Inference
– Model Evidence, Bayes factors (cf. p-values)

• Model Estimation
– Variational Bayes

• Groups of subjects
– RFX model inference, PPM model inference
General Linear Model

Model:         y  X  e

X
Prior

Model:           y  X  e

2         Prior:   p(  2 )  N k (0,  2 1 I k )


 exp( 2 T  / 2)

1
Prior

Model:             y  X  e

2
Prior:     p(  2 )  N k (0,  2 1 I k )


 exp( 2 T  / 2)

1

Sample curves from prior
(before observing any data)
Z
Mean curve

x
Priors and likelihood

Model:                 y  X  e

2
Prior:         p(  2 )  N k (0,  2 1 I k )


 exp( 2 T  / 2)
Likelihood:
N
p( y  , 1 )   p( yi |  , 11 )
1                                       i 1

p( yi  , 1 )  N ( X i , 11 )
 exp(1 ( yi  X i ) 2 / 2)

X

x
Priors and likelihood

Model:                 y  X  e

2
Prior:         p(  2 )  N k (0,  2 1 I k )


 exp( 2 T  / 2)
Likelihood:
N
p( y  , 1 )   p( yi |  , 11 )
1                                       i 1

p( yi  , 1 )  N ( X i , 11 )
 exp(1 ( yi  X i ) 2 / 2)

X

x
Posterior after one observation

Model:                      y  X  e

2
Prior:           p(  2 )  N k (0,  2 1 I k )


 exp( 2 T  / 2)
Likelihood:
N
p ( y  ,  1 )   p ( yi |  ,  1 )
1                                      i 1

Bayes Rule:
p( y, )  p( y |  , ) p( |  )

X
Posterior:       p | y,               N  , C 

C  1 X T X   2 I k              1

  1CX T y
x
Posterior after two observations

Model:                      y  X  e

2
Prior:           p(  2 )  N k (0,  2 1 I k )


 exp( 2 T  / 2)
Likelihood:
N
p ( y  ,  1 )   p ( yi |  ,  1 )
1                                      i 1

Bayes Rule:
p( y, )  p( y |  , ) p( |  )

X
Posterior:       p | y,               N  , C 

C  1 X T X   2 I k              1

  1CX T y
x
Posterior after eight observations

Model:                      y  X  e

2
Prior:           p(  2 )  N k (0,  2 1 I k )


 exp( 2 T  / 2)
Likelihood:
N
p ( y  ,  1 )   p ( yi |  ,  1 )
1                                      i 1

Bayes Rule:
p( y, )  p( y |  , ) p( |  )

X
Posterior:       p | y,               N  , C 

C  1 X T X   2 I k              1

  1CX T y
x
Overview

• Parameter Inference
– GLMs, PPMs, DCMs

• Model Inference
– Model Evidence, Bayes factors (cf. p-values)

• Model Estimation
– Variational Bayes

• Groups of subjects
– RFX model inference, PPM model inference
SPM Interface
Posterior Probability Maps

Y  X                                    
p   N 0,  2 1 L1



prior precision   prior precision
aMRI          Smooth Y (RFT)                  of GLM coeff      of AR coeff

                
Observation
noise

               
     GLM         A          AR coeff
(correlated noise)

ML                 Bayesian                            Y    observations
ROC curve

Sensitivity

1-Specificity
Posterior Probability Maps
Display only voxels
that exceed e.g. 95%
activation
p  pth
threshold
sth

Probability mass p

Mean (Cbeta_*.img)

Posterior density                    PPM (spmP_*.img)

probability of getting an effect, given the data

q( n )  N (  n ,  n )     mean: size of effect
Std dev (SDbeta_*.img)
covariance: uncertainty
Overview

• Parameter Inference
– GLMs, PPMs, DCMs

• Model Inference
– Model Evidence, Bayes factors (cf. p-values)

• Model Estimation
– Variational Bayes

• Groups of subjects
– RFX model inference, PPM model inference
Dynamic Causal Models

SPC    Posterior Density

V1

V5

Priors
Are
Physiological

V5->SPC
Overview

• Parameter Inference
– GLMs, PPMs, DCMs

• Model Inference
– Model Evidence, Bayes factors (cf. p-values)

• Model Estimation
– Variational Bayes

• Groups of subjects
– RFX model inference, PPM model inference
Model Evidence

Bayes Rule:
p ( y |  , m) p ( | m)
p ( y, m) 
p ( y m)
normalizing constant

Model evidence

p( y m)   p( y |  , m) p( | m)d
Model                                  Model                          Bayes factor:
Posterior        Evidence              Prior                     p(y | m  i)
Bij 
p(y | m  j )
p ( y | m) p ( m)
p(m | y ) 
p(y )

Model, m=i                            Model, m=j

SPC                                  SPC

V1                                 V1

V5                                   V5
Model                                  Model        Bayes factor:
Posterior       Evidence               Prior         p(y | m  i)
Bij 
p(y | m  j )
p ( y | m) p ( m)
p(m | y ) 
p(y )

For
Equal
Model
Priors
Overview

• Parameter Inference
– GLMs, PPMs, DCMs

• Model Inference
– Model Evidence, Bayes factors (cf. p-values)

• Model Estimation
– Variational Bayes

• Groups of subjects
– RFX model inference, PPM model inference
Bayes Factors versus p-values
Two sample t-test

Subjects

Conditions
p=0.05
Bayesian

BF=3

Classical
Bayesian

BF=20
BF=3

Classical
p=0.05
Bayesian

BF=20
BF=3

Classical
Bayesian        p=0.01   p=0.05

BF=20
BF=3

Classical
Model Evidence Revisited

p( y m)   p( y |  , m) p( | m)d

log p ( y | m) 
accuracy(m)  complexity(m)

accuracy(m)  1 y  Z  ...
2

complexity(m)   2   0            ...
2
Overview

• Parameter Inference
– GLMs, PPMs, DCMs

• Model Inference
– Model Evidence, Bayes factors (cf. p-values)

• Model Estimation
– Variational Bayes

• Groups of subjects
– RFX model inference, PPM model inference
Free Energy Optimisation
Initial
Point
Precisions, 

Parameters, 
Overview

• Parameter Inference
– GLMs, PPMs, DCMs

• Model Inference
– Model Evidence, Bayes factors (cf. p-values)

• Model Estimation
– Variational Bayes

• Groups of subjects
– RFX model inference, PPM model inference
incorrect model (m2)                 correct model (m1)

u2                                 u2

x3                               x3

u1        x1              x2        u1       x1            x2

m2                                               m1
Simulated data sets

-5        -4   -3    -2         -1   0    1   2        3        4    5
Log model evidence differences
Figure 2
LD                                                      LD|LVF

MOG         FG              FG           MOG                     MOG     FG       FG            MOG

LD|RVF                                                  LD|LVF           LD                                    LD

LG              LG                                           LG       LG

RVF        LD              LVF                                   RVF LD|RVF       LVF
stim.                      stim.                                 stim.            stim.

m2                                            m1
Subjects

Models from
Klaas Stephan
-35      -30   -25        -20        -15          -10    -5      0   5
Log model evidence differences
Random Effects (RFX) Inference

A         log p(yn|m)
log p(y|a)
0.8

0.6                            5

0.4                 Subjects   10
r

0.2                            15

0                             20
1 2 3 4 5 6                   1 2 3 4 5 6
Models                        Models
Gibbs Sampling
Initial
Point

p(r | A, y )
Frequencies, r

Stochastic Method

Assignments, A               p( A | r , Y )
log p(yn|m)
log p(y|a)

u nm  exp[log p ( yn | m)  log rm ]
 m     anm
0
m
unm
n   g nm                                         Gibbs
r  Dir( )                 unm'
m'
Sampling
p(r | A, y )   an  Mult( g n )

p( A | r , Y )
LD                                                      LD|LVF

MOG         FG              FG           MOG                     MOG     FG       FG            MOG

LD|RVF                                                  LD|LVF           LD                                    LD

LG              LG                                           LG       LG

RVF        LD              LVF                                   RVF LD|RVF       LVF
stim.                      stim.                                 stim.            stim.

m2                                            m1
Subjects

11/12=0.92

-35      -30   -25        -20        -15          -10    -5      0   5
Log model evidence differences
p(r >0.5 | y) = 0.997
1
5

4.5

4

3.5

3
p(r 1|y)

2.5

2

1.5

1

0.5                                                     r1  0.843

0
0   0.1   0.2   0.3   0.4       0.5       0.6   0.7   0.8    0.9   1
r
1
Overview

• Parameter Inference
– GLMs, PPMs, DCMs

• Model Inference
– Model Evidence, Bayes factors (cf. p-values)

• Model Estimation
– Variational Bayes

• Groups of subjects
– RFX model inference, PPM model inference
PPMs for Models
log p( y m)  F (q)

Log-evidence maps

subject 1
model 1
subject N

model K

Compute log-evidence
for each model/subject
PPMs for Models
log p( y m)  F (q)

Log-evidence maps                                                         BMS maps

subject 1
model 1
subject N
q(rk  0.5)  0.941
rk                PPM

q(rk )

model K
k                EPM
rk
Probability that model k
generated data
Compute log-evidence                                         Rosa et al Neuroimage, 2009
for each model/subject
Computational fMRI: Harrison et al (in prep)

Long
Short                                        Time
Time Scale                                      Scale

Frontal cortex
Primary
visual cortex
Non-nested versus nested comparison
For detecting model B:

Non-nested:

Compare model A
versus model B

Nested:

Compare model A
versus model AB

Penny et al, HBM,2007
Double Dissociations
Long
Short                                Time
Time Scale                              Scale

Frontal cortex
Primary
visual cortex
Summary

• Parameter Inference
– GLMs, PPMs, DCMs

• Model Inference
– Model Evidence, Bayes factors (cf. p-values)

• Model Estimation
– Variational Bayes

• Groups of subjects
– RFX model inference, PPM model inference

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 27 posted: 4/11/2012 language: English pages: 56