The General Linear Model (for dummies…) Carmen Tur and Ashwani Jha 2009.

Slides:



Advertisements
Similar presentations
Hierarchical Models and
Advertisements

Overview of SPM p <0.05 Statistical parametric map (SPM)
General Linear Model L ύ cia Garrido and Marieke Schölvinck ICN.
General Linear Model Beatriz Calvo Davina Bristow.
1 st Level Analysis: design matrix, contrasts, GLM Clare Palmer & Misun Kim Methods for Dummies
SPM 2002 C1C2C3 X =  C1 C2 Xb L C1 L C2  C1 C2 Xb L C1  L C2 Y Xb e Space of X C1 C2 Xb Space X C1 C2 C1  C3 P C1C2  Xb Xb Space of X C1 C2 C1 
Outline What is ‘1st level analysis’? The Design matrix
Group analyses of fMRI data Methods & models for fMRI data analysis in neuroeconomics November 2010 Klaas Enno Stephan Laboratory for Social and Neural.
The General Linear Model Or, What the Hell’s Going on During Estimation?
The General Linear Model (GLM) Methods & models for fMRI data analysis in neuroeconomics November 2010 Klaas Enno Stephan Laboratory for Social & Neural.
The General Linear Model (GLM)
The General Linear Model (GLM) SPM Course 2010 University of Zurich, February 2010 Klaas Enno Stephan Laboratory for Social & Neural Systems Research.
Group analyses of fMRI data Methods & models for fMRI data analysis 28 April 2009 Klaas Enno Stephan Laboratory for Social and Neural Systems Research.
Multiple comparison correction Methods & models for fMRI data analysis 29 October 2008 Klaas Enno Stephan Branco Weiss Laboratory (BWL) Institute for Empirical.
Group analyses of fMRI data Methods & models for fMRI data analysis 26 November 2008 Klaas Enno Stephan Laboratory for Social and Neural Systems Research.
1st level analysis: basis functions and correlated regressors
Methods for Dummies General Linear Model
1st Level Analysis Design Matrix, Contrasts & Inference
General Linear Model & Classical Inference
General Linear Model & Classical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM M/EEGCourse London, May.
The General Linear Model
Contrasts and Basis Functions Hugo Spiers Adam Liston.
Computational Biology VI
With many thanks for slides & images to: FIL Methods group, Virginia Flanagin and Klaas Enno Stephan Dr. Frederike Petzschner Translational Neuromodeling.
General Linear Model & Classical Inference London, SPM-M/EEG course May 2014 C. Phillips, Cyclotron Research Centre, ULg, Belgium
SPM Course Zurich, February 2015 Group Analyses Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London With many thanks to.
FMRI Methods Lecture7 – Review: analyses & statistics.
SPM short course – Oct Linear Models and Contrasts Jean-Baptiste Poline Neurospin, I2BM, CEA Saclay, France.
Group analyses of fMRI data Methods & models for fMRI data analysis November 2012 With many thanks for slides & images to: FIL Methods group, particularly.
Wellcome Dept. of Imaging Neuroscience University College London
General Linear Model. Y1Y2...YJY1Y2...YJ = X 11 … X 1l … X 1L X 21 … X 2l … X 2L. X J1 … X Jl … X JL β1β2...βLβ1β2...βL + ε1ε2...εJε1ε2...εJ Y = X * β.
Contrasts & Statistical Inference
Spatial smoothing of autocorrelations to control the degrees of freedom in fMRI analysis Keith Worsley Department of Mathematics and Statistics, McGill.
Methods for Dummies Second level Analysis (for fMRI) Chris Hardy, Alex Fellows Expert: Guillaume Flandin.
General Linear Model and fMRI Rachel Denison & Marsha Quallo Methods for Dummies 2007.
FMRI Modelling & Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course Chicago, Oct.
Idiot's guide to... General Linear Model & fMRI Elliot Freeman, ICN. fMRI model, Linear Time Series, Design Matrices, Parameter estimation,
The General Linear Model
The General Linear Model Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM fMRI Course London, May 2012.
SPM short – Mai 2008 Linear Models and Contrasts Stefan Kiebel Wellcome Trust Centre for Neuroimaging.
1 st level analysis: Design matrix, contrasts, and inference Stephane De Brito & Fiona McNabe.
The general linear model and Statistical Parametric Mapping I: Introduction to the GLM Alexa Morcom and Stefan Kiebel, Rik Henson, Andrew Holmes & J-B.
Variance components Wellcome Dept. of Imaging Neuroscience Institute of Neurology, UCL, London Stefan Kiebel.
The general linear model and Statistical Parametric Mapping II: GLM for fMRI Alexa Morcom and Stefan Kiebel, Rik Henson, Andrew Holmes & J-B Poline.
The General Linear Model Christophe Phillips SPM Short Course London, May 2013.
The General Linear Model Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM fMRI Course London, October 2012.
SPM short course – Mai 2008 Linear Models and Contrasts Jean-Baptiste Poline Neurospin, I2BM, CEA Saclay, France.
General Linear Model & Classical Inference London, SPM-M/EEG course May 2016 Sven Bestmann, Sobell Department, Institute of Neurology, UCL
The General Linear Model …a talk for dummies
The General Linear Model (GLM)
The General Linear Model (GLM)
The general linear model and Statistical Parametric Mapping
The General Linear Model
Design Matrix, General Linear Modelling, Contrasts and Inference
and Stefan Kiebel, Rik Henson, Andrew Holmes & J-B Poline
The General Linear Model (GLM)
Contrasts & Statistical Inference
The General Linear Model
Rachel Denison & Marsha Quallo
The general linear model and Statistical Parametric Mapping
The General Linear Model
Hierarchical Models and
The General Linear Model (GLM)
Chapter 3 General Linear Model
MfD 04/12/18 Alice Accorroni – Elena Amoruso
The General Linear Model
The General Linear Model (GLM)
The General Linear Model
The General Linear Model
Contrasts & Statistical Inference
Presentation transcript:

The General Linear Model (for dummies…) Carmen Tur and Ashwani Jha 2009

Overview of SPM RealignmentSmoothing Normalisation General linear model Statistical parametric map (SPM) Image time-series Parameter estimates Design matrix Template Kernel Gaussian field theory p <0.05 Statisticalinference

What is the GLM? It is a model (ie equation) It provides a framework that allows us to make refined statistical inferences taking into account: – the (preprocessed) 3D MRI images – time information (BOLD time series) – user defined experimental conditions – neurobiologically based priors (HRF) – technical / noise corrections

How does work? By creating a linear model: Collect Data X Y Data

How does work? By creating a linear model: Collect Data Generate model X Y Data Y=bx + c

How does work? By creating a linear model: Collect Data Generate model Fit model X Y Data Y=0.99x e e   N t t e 1 2 = minimum

How does work? By creating a linear model: Collect Data Generate model Fit modelTest model X Y Data Y=0.99x e e

GLM matrix format Y = β 1 X 1 + C + e But GLM works with lists of numbers (matrices) Y = 0.99x e

GLM matrix format But GLM works with lists of numbers (matrices) Y = β 1 X 1 + β 2 X2 + C + e Y = 0.99x e ‘non-linear’ We need to put this in… (data Y, and design matrix Xs) sphericity assumption

GLM matrix format = + y y X X

fMRI example (from SPM course)…

Passive word listening versus rest 7 cycles of rest and listening Blocks of 6 scans with 7 sec TR Question: Is there a change in the BOLD response between listening and rest? Stimulus function One session A very simple fMRI experiment

Time BOLD signal Time A closer look at the data (Y)… Look at each voxel over time (mass univariate)

BOLD signal Time = + error e 22 + x2x2  1 x1x1 The rest of the model… Instead of C

The GLM matrix format = + y X

…easy! How to solve the model (parameter estimation) Assumptions (sphericity of error)

Actually try to estimate  ‘best’  has lowest overall error ie the sum of squares of the error: But how does this apply to GLM, where X is a matrix… ^ Solving the GLM (finding  ) Y=0.99x e e   N t t e 1 2 = minimum ^

…need to geometrically visualise the GLM in N dimensions = + y x 1 x 2 N ^ ^

…need to geometrically visualise the GLM = + y x 1 x 2 N=3 x2x2 x1x1 Design space defined by y = X  ^ ^ ^ What about the actual data y?

…need to geometrically visualise the GLM = + y x 1 x 2 N=3 x2x2 x1x1 Design space defined by y = X  ^ ^ ^ y

Once again in 3D.. The design (X) can predict the data values (y) in the design space. The actual data y, usually lies outside this space. The ‘error’ is difference. y e Design space defined by X x1x1 x2x2  ˆ ˆ Xy  ^

Solving the GLM (finding  ) – ordinary least squares (OLS) To find minimum error: e has to be orthogonal to design space (X). “Project data onto model” ie: X T e = 0 X T (y - X  ) = 0 X T y = X T X  y e Design space defined by X x1x1 x2x2  ˆ ˆ Xy    N t t e 1 2 = minimum

Assuming sphericity We assume that the error has: – a mean of 0, – is normally distributed – is independent (does not correlate with itself) =

Assuming sphericity We assume that the error has: – a mean of 0, – is normally distributed – is independent (does not correlate with itself) = x

Solution Half-way re-cap… = + Ordinary least squares estimation (OLS) (assuming i.i.d. error): y X GLM

Methods for dummies London, 4th November 2009 II part Carmen Tur

I. BOLD responses have a delayed and dispersed form HRF Neural stimulus  hemodynamic response time Neural stimulus Hemodynamic Response Function: This is the expected BOLD signal if a neural stimulus takes place expected BOLD response = input function  impulse response function (HRF) expected BOLD response  Problems of this model

I. BOLD responses have a delayed and dispersed form Solution: CONVOLUTION  HRF Transform neural stimuli function into a expected BOLD signal with a canonical hemodynamic response function (HRF) Problems of this model

II. The BOLD signal includes substantial amounts of low-frequency noise Problems of this model WHY? Multifactorial: biorhythms, coil heating, etc… HOW MAY OUR DATA LOOK LIKE? Intensity Of BOLD signal Time Real data Predicted response, NOT taking into account low- frequency drift

II. The BOLD signal includes substantial amounts of low-frequency noise Problems of this model Solution: HIGH PASS FILTERING discrete cosine transform (DCT) set

STEPS so far… Interim summary: GLM so far… 1.Acquisition of our data (Y) 2.Design our matrix (X) 3.Assumptions of GLM 4.Correction for BOLD signal shape: convolution 5.Cleaning of our data of low-frequency noise 6.Estimation of βs But our βs may still be wrong! Why? 7.Checkup of the error… Are all the assumptions of the error satisfied?

III. The data are serially correlated Temporal autocorrelation: in y = Xβ + e over time 0 It is… t e e in time t is correlated with e in time t-1 Problems of this model It should be… 0 t e

III. The data are serially correlated Temporal autocorrelation: in y = Xβ + e over time WHY? Multifactorial… Problems of this model

III. The data are serially correlated Temporal autocorrelation: in y = Xβ + e over time e t = ae t-1 + ε (assuming ε ~ N(0,σ 2 I)) Problems of this model autocovariance function Autoregressive model in other words: the covariance of error at time t (e t ) and error at time t-1 (e t-1 ) is not zero

III. The data are serially correlated Temporal autocorrelation: in y = Xβ + e over time e t = ae t-1 + ε (assuming ε ~ N(0,σ 2 I)) Problems of this model Autoregressive model e t = ae t-1 + ε e t = a (ae t-2 + ε) + ε e t = a 2 e t-2 + aε + ε e t = a 2 (ae t-3 + ε) + aε + ε e t = a 3 e t-3 + a 2 ε + aε + ε … e t -1 = ae t-2 + ε e t -2 = ae t-3 + ε … But a is a number between 0 and 1

Problems of this model in other words: the covariance of error at time t (e t ) and error at time t-1 (e t-1 ) is not zero time (scans) time (scans) ERROR: Covariance matrix

III. The data are serially correlated Temporal autocorrelation: in y = Xβ + e over time e t = ae t-1 + ε (assuming ε ~ N(0,σ 2 I)) autocovariance function Problems of this model Autoregressive model This violates the assumption of the error e ~ N (0, σ 2 I ) in other words: the covariance of error at time t (e t ) and error at time t-1 (e t-1 ) is not zero

III. The data are serially correlated Solution: 1. Use an enhanced noise model with hyperparameters for multiple error covariance components Problems of this model It should be… It is… e t = ae t-1 + ε a ≠ 0 a = 0 e t = ae t-1 + ε e t = ε But…a? ? e t = ε Or, if you wish

III. The data are serially correlated Solution: 1. Use an enhanced noise model with hyperparameters for multiple error covariance components Problems of this model It should be… It is… e t = ae t-1 + ε a ≠ 0a = 0 e t = ae t-1 + ε e t = ε But…a? ? We would like to know covariance (a, autocovariance) of error But we can only estimate it: V  V = Σ λ i Q i V = λ 1 Q 1 + λ 2 Q 2 λ 1 and λ 2 : hyperparameters Q 1 and Q 2 : multiple error covariance components

III. The data are serially correlated Solution: 1. Use an enhanced noise model with hyperparameters for multiple error covariance components 2. Use estimated autocorrelation to specify filter matrix W for whitening the data e t = ae t-1 + ε (assuming ε ~ N(0,σ 2 I)) WY = WXβ + We Problems of this model

Other problems – Physiological confounds head movements arterial pulsations (particularly bad in brain stem) breathing eye blinks (visual cortex) adaptation affects, fatigue, fluctuations in concentration, etc.

Other problems – Correlated regressors Example: y = x 1 β 1 + x 2 β 2 + e When there is high (but not perfect) correlation between regressors, parameters can be estimated… But the estimates will be inefficiently estimated (ie highly variable)

HRF varies substantially across voxels and subjects For example, latency can differ by ± 1 second Solution: MULTIPLE BASIS FUNCTIONS (another talk) Other problems – Variability in the HRF HRF could be understood as a linear combination of A, B and C A B C

Model everything Important to model all known variables, even if not experimentally interesting: effects-of-interest (the regressors we are actually interested in) + head movement, block and subject effects… subjects global activity or movement conditions: effects of interest Ways to improve the model Minimise residual error variance

The aim of modelling the measured data was to make inferences about effects of interest Contrasts allow us to make such inferences How? T-tests and F-tests How to make inferences REMEMBER!! Another talk!!!

Using an easy example... SUMMARY

Given data (image voxel, y) Y = X. β + ε

Different (rigid and known) predictors (regressors, design matrix, X) x1x1 x2x2 x3x3 x4x4 x5x5 x6x6 Time Y = X. β + ε

Fitting our models into our data (estimation of parameters, β) x1x1 x2x2 x3x3 x4x4 x5x5 x6x6 Y = X. β + ε

HOW? Fitting our models into our data (estimation of parameters, β) Minimising residual error variance

e (error) = y o - y e Minimising the Sums of Squares of the Error differences between your predicted model and the observed data

y = x x 2 3+ x 3 1+ x 4 2+ x 5 1+ x e Y = X. β + ε Fitting our models into our data (estimation of parameters, β) y = x 1 β 1 + x 2 β 2 + x 3 β 3 + x 4 β 4 + x 5 β 5 + x 6 β 6 + e We must pay attention to the problems that the GLM has…

Y = X. β + ε Making inferences: our final goal!! The end

REFERENCES 1.Talks from previous years 2.Human brain function THANKS TO GUILLAUME FLANDIN Many thanks for your attention London 4th Nov 2009 GENERAL LINEAR MODEL – Methods for Dummies