Bayesian Inference

Post on 12-Jan-2016

60 views 0 download

Tags:

description

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. Gaussian - PowerPoint PPT Presentation

Transcript of Bayesian Inference

Bayesian Inference

Will Penny

SPM for fMRI Course,London, October 21st, 2010

Wellcome Centre for Neuroimaging, UCL, UK.

What is Bayesian Inference ?

(From Daniel Wolpert)

realignmentrealignment smoothingsmoothing

normalisationnormalisation

general linear modelgeneral linear model

templatetemplate

Gaussian Gaussian field theoryfield theory

p <0.05p <0.05

statisticalstatisticalinferenceinference

Bayesian segmentationand normalisation

Bayesian segmentationand normalisation

realignmentrealignment smoothingsmoothing

normalisationnormalisation

general linear modelgeneral linear model

templatetemplate

Gaussian Gaussian field theoryfield theory

p <0.05p <0.05

statisticalstatisticalinferenceinference

Bayesian segmentationand normalisation

Bayesian segmentationand normalisation

Smoothnessmodelling

Smoothnessmodelling

realignmentrealignment smoothingsmoothing

normalisationnormalisation

general linear modelgeneral linear model

templatetemplate

Gaussian Gaussian field theoryfield theory

p <0.05p <0.05

statisticalstatisticalinferenceinference

Bayesian segmentationand normalisation

Bayesian segmentationand normalisation

Smoothnessestimation

Smoothnessestimation

Posterior probabilitymaps (PPMs)

Posterior probabilitymaps (PPMs)

realignmentrealignment smoothingsmoothing

normalisationnormalisation

general linear modelgeneral linear model

templatetemplate

Gaussian Gaussian field theoryfield theory

p <0.05p <0.05

statisticalstatisticalinferenceinference

Bayesian segmentationand normalisation

Bayesian segmentationand normalisation

Smoothnessestimation

Smoothnessestimation

Dynamic CausalModelling

Dynamic CausalModelling

Posterior probabilitymaps (PPMs)

Posterior probabilitymaps (PPMs)

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

eXy Model:

X

1

2

eXy Model:

Prior:

)2/exp(

),0()(

2

122

T

kk INp

Prior

Sample curves from prior (before observing any data)

Mean curve

x

Z

1

2

eXy Model:

Prior:

)2/exp(

),0()(

2

122

T

kk INp

Prior

1

2

Priors and likelihood

1

2

)2/)(exp(

),(),(

),|(),(

21

111

1

111

ii

ii

N

ii

Xy

XNyp

ypyp

eXy Model:

Prior:

)2/exp(

),0()(

2

122

T

kk INp

Likelihood:

x

X

1

2

eXy Model:

Prior:

)2/exp(

),0()(

2

122

T

kk INp

Likelihood:

)2/)(exp(

),(),(

),|(),(

21

111

1

111

ii

ii

N

ii

Xy

XNyp

ypyp

x

X

Priors and likelihood

yCX

IXXC

CNyp

T

kT

1

1

21

, ,|

x

X

eXy Model:

Prior:

)2/exp(

),0()(

2

122

T

kk INp

Likelihood:

Bayes Rule:

)|(),|(),( pypyp

Posterior:

N

iiypyp

111 ),|(),(

1

2

Posterior after one observation

1

2

x

X

yCX

IXXC

CNyp

T

kT

1

1

21

, ,|

eXy Model:

Prior:

)2/exp(

),0()(

2

122

T

kk INp

Likelihood:

Bayes Rule:

)|(),|(),( pypyp

Posterior:

N

iiypyp

111 ),|(),(

Posterior after two observations

1

2

yCX

IXXC

CNyp

T

kT

1

1

21

, ,|

eXy Model:

Prior:

)2/exp(

),0()(

2

122

T

kk INp

Likelihood:

Bayes Rule:

)|(),|(),( pypyp

Posterior:

N

iiypyp

111 ),|(),(

Posterior after eight observations

x

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

AR coeff(correlated noise)

prior precisionof AR coeff

A

Bayesian ML

aMRI Smooth Y (RFT)

Posterior Probability Maps

observations

GLM

prior precisionof GLM coeff

Observation noise

Y

112,0 LNp XY

Sen

sitiv

ity

1-Specificity

ROC curve

Mean (Cbeta_*.img)

Std dev (SDbeta_*.img)

activation threshold

ths

Posterior density

Probability mass p

probability of getting an effect, given the dataprobability of getting an effect, given the data

),()( nnn Nq mean: size of effectcovariance: uncertainty

thpp

Display only voxels that exceed e.g. 95%Display only voxels that exceed e.g. 95%

PPM (spmP_*.img)

Posterior Probability Maps

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

V1

V5

SPC

V5->SPC

Posterior Density

PriorsAre Physiological

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:

)(

)|(),|(),(

myp

mpmypmyp

normalizing constant

dmpmypmyp )|(),|()(

Model evidence

( | ) ( )( | )

( )

p m p mp m

p

yy

y

PriorPosterior EvidenceModel Model Bayes factor:

( | )

( | )ij

p m iB

p m j

y

y

V1

V5

SPC

V1

V5

SPC

Model, m=i Model, m=j

( | ) ( )( | )

( )

p m p mp m

p

yy

y

PriorPosterior EvidenceModel Model Bayes factor:

( | )

( | )ij

p m iB

p m j

y

y

For EqualModelPriors

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

Bay

esia

n

Classical

p=0.05

BF=3

Bay

esia

n

Classical

BF=3

BF=20

Bay

esia

n

Classical

BF=3

BF=20

p=0.05

Bay

esia

n

Classical

BF=3

BF=20

p=0.05p=0.01

Model Evidence Revisited

dmpmypmyp )|(),|()(

)()(

)|(log

mcomplexitymaccuracy

myp

...)(

...)(2

02

2

1

mcomplexity

Zymaccuracy

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 OptimisationInitial Point

Parameters,

Pre

cisi

ons,

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

-5 -4 -3 -2 -1 0 1 2 3 4 5

Sim

ulat

ed d

ata

sets

Log model evidence differences

x1 x2u1

x3

u2

x1 x2u1

x3

u2

incorrect model (m2) correct model (m1)

Figure 2

m2 m1

-35 -30 -25 -20 -15 -10 -5 0 5

Sub

ject

s

Log model evidence differences

MOG

LG LG

RVFstim.

LVFstim.

FGFG

LD|RVF

LD|LVF

LD LD

MOGMOG

LG LG

RVFstim.

LVFstim.

FGFG

LD

LD

LD|RVF LD|LVF

MOG

m2 m1

Models from Klaas Stephan

1 2 3 4 5 60

0.2

0.4

0.6

0.8

r

Models

A

Models

Sub

ject

s

1 2 3 4 5 6

5

10

15

20

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

Random Effects (RFX) Inference

Gibbs SamplingInitial Point

Assignments, A

Fre

quen

cies

, r

Stochastic Method

),|( YrAp

),|( yArp

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

)(

]log)|(exp[log

''

nn

mnm

nmnm

mnnm

gMulta

u

ug

rmypu

)(

0

Dirr

an

nmmm

),|( YrAp

),|( yArp

GibbsSampling

-35 -30 -25 -20 -15 -10 -5 0 5

Sub

ject

s

Log model evidence differences

MOG

LG LG

RVFstim.

LVFstim.

FGFG

LD|RVF

LD|LVF

LD LD

MOGMOG

LG LG

RVFstim.

LVFstim.

FGFG

LD

LD

LD|RVF LD|LVF

MOG

m2 m1

11/12=0.92

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

r1

p(r 1

|y)

p(r1>0.5 | y) = 0.997

843.01 r

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 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

kr

k

BMS mapsBMS maps

PPMPPM

EPMEPM

)()(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

PPMs for Models

Rosa et al Neuroimage, 2009

Primary visual cortex

ShortTime Scale

Long TimeScale

Frontal cortex

Computational fMRI: Harrison et al (in prep)

Non-nested versus nested comparison

Non-nested:

Compare model A versus model B

Nested:

Compare model A versus model AB

For detecting model B:

Penny et al, HBM,2007

Primary visual cortex

ShortTime Scale

Long TimeScale

Frontal cortex

Double Dissociations

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