General Linear Model & Classical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM M/EEGCourse London, May 2013 š¦=š Preprocessings š½+š General Linear Model š½ = šš š −1 Random Contrast c Field Theory Statistical Inference šš š¦ šš š š2 = šššš(š) ššš{š, š¹} time frequency mm 1D time time mm Statistical Parametric Maps mm mm time 2D+t scalp-time 2D time-frequency mm 3D M/EEG source reconstruction, fMRI, VBM ERP example ļ± Random presentation of ‘faces’ and ‘scrambled faces’ ļ± 70 trials of each type ļ± 128 EEG channels Question: is there a difference between the ERP of ‘faces’ and ‘scrambled faces’? ERP example: channel B9 Focus on N170 tļ½ ļf ļ ļs ļ© ļ³ 2 ļ¦ļ§ 1n ļ« 1n ļ¶ļ· sļø ļØ f compares size of effect to its error standard deviation Data modelling Data Faces = b1 Y = b1 • X1 Scrambled + b2 + b2 + • X2 + ļ„ Design matrix b1 = Y = b2 X • b + + ļ„ General Linear Model p 1 1 1 b p y N = N X y ļ½ Xb ļ« e e ~ N (0,ļ³ I ) 2 + N e Model is specified by 1. Design matrix X 2. Assumptions about e N: number of scans p: number of regressors The design matrix embodies all available knowledge about experimentally controlled factors and potential confounds. GLM: a flexible framework for parametric analyses • • • • • • • • one sample t-test two sample t-test paired t-test Analysis of Variance (ANOVA) Analysis of Covariance (ANCoVA) correlation linear regression multiple regression Parameter estimation b1 = Y b2 X y ļ½ Xb ļ« e Objective: estimate parameters to minimize N ļ„e t ļ½1 + eˆ Ordinary least squares estimation (OLS) (assuming i.i.d. error): bˆ ļ½ ( X T X )ļ1 X T y 2 t Mass-univariate analysis: voxel-wise GLM Evoked response image Time Sensor to voxel transform 1. Transform data for all subjects and conditions 2. SPM: Analyse data at each voxel Hypothesis Testing To test an hypothesis, we construct “test statistics”. ļ± Null Hypothesis H0 Typically what we want to disprove (no effect). ļ° The Alternative Hypothesis HA expresses outcome of interest. ļ± Test Statistic T The test statistic summarises evidence about H0. Typically, test statistic is small in magnitude when the hypothesis H0 is true and large when false. ļ° We need to know the distribution of T under the null hypothesis. Null Distribution of T Hypothesis Testing uļ” ļ± Significance level α: Acceptable false positive rate α. ļ° threshold uα Threshold uα controls the false positive rate ļ” ļ” ļ½ p(T ļ¾ uļ” | H0 ) Null Distribution of T ļ± Conclusion about the hypothesis: We reject the null hypothesis in favour of the alternative hypothesis if t > uα ļ± p-value: A p-value summarises evidence against H0. This is the chance of observing value more extreme than t under the null hypothesis. š š > š”|š»0 t p-value Null Distribution of T Contrast & t-test Contrast : specifies linear combination of parameter vector: c T b SPM-t over time & space cT = -1 +1 ERP: faces < scrambled ? = bˆ1 ļ¼ bˆ2? ļ 1bˆ1 ļ« 1bˆ2 ļ¾ 0? T Test H0: c bˆ ļ¾ 0? contrast of estimated parameters t= variance estimate Tļ½ cT bˆ ļ³ˆ 2 cT ļØX T X ļ© c ļ1 ~ tN ļ p T-test: summary ļ± T-test is a signal-to-noise measure (ratio of estimate to standard deviation of estimate). ļ± Alternative hypothesis: H0: cT b ļ½ 0 vs HA: cT b ļ¾ 0 ļ± T-contrasts are simple combinations of the betas; the Tstatistic does not depend on the scaling of the regressors or the scaling of the contrast. Extra-sum-of-squares & F-test Model comparison: Full vs. Reduced model? Null Hypothesis H0: True model is X0 (reduced model) X0 X1 X0 RSS 2 ˆ ļ„ ļ„ full Test statistic: ratio of explained and unexplained variability (error) RSS0 2 ˆ ļ„ ļ„ reduced RSS 0 ļ RSS Fļµ RSS ESS Fļµ ~ Fļ® 1 ,ļ® 2 RSS Full model ? Or reduced model? ļ®1 = rank(X) – rank(X0) ļ®2 = N – rank(X) F-test & multidimensional contrasts Tests multiple linear hypotheses: H0: True model is X0 X0 X1 (b3-4) X0 Full or reduced model? H 0 : b3 = b4 = 0 cT = 0 0 1 0 0001 test H0 : cTb = 0 ? F-test: summary ļ± F-tests can be viewed as testing for the additional variance explained by a larger model wrt a simpler (nested) model ļ° model comparison. ļ± F tests a weighted sum of squares of one or several combinations of the regression coefficients b. ļ± In practice, we don’t have to explicitly separate X into [X1X2] thanks to multidimensional contrasts. ļ± Hypotheses: ļ©1 ļŖ0 ļŖ ļŖ0 ļŖ ļ«0 0 1 0 0 0 0 1 0 0ļ¹ 0ļŗļŗ 0ļŗ ļŗ 0ļ» Null HypothesisH0 : b1 ļ½ b2 ļ½ b3 ļ½ 0 Alternative HypothesisH A : at least one bk ļ¹ 0 ļ± In testing uni-dimensional contrast with an F-test, for example b1 – b2, the result will be the same as testing b2 – b1. It will be exactly the square of the t-test, testing for both positive and negative effects. Orthogonal regressors Variability described by š1 Testing for š1 Variability described by š2 Testing for š2 Variability in Y Correlated regressors Variability described by Variability described by Shared variance Variability in Y Correlated regressors Variability described by Variability described by Testing for š1 Variability in Y Correlated regressors Variability described by Variability described by Testing for š2 Variability in Y Variability described by Variability described by Correlated regressors Variability in Y Correlated regressors Variability described by Variability described by Testing for š1 Variability in Y Correlated regressors Variability described by Variability described by Testing for š2 Variability in Y Correlated regressors Variability described by Variability described by Testing for š1 and/or š2 Variability in Y Summary ļ± Mass-univariate GLM: – Fit GLMs with design matrix, X, to data at different points in space to estimate local effect sizes, b – GLM is a very general approach (one-sample, two-sample, paired t-tests, ANCOVAs, …) ļ± Hypothesis testing framework – Contrasts – t-tests – F-tests Multiple covariance components Ci ļ½ ļ³ V 2 i enhanced noise model at voxel i ei ~ N (0, Ci ) V ļ½ ļ„ ļ¬ jQ j error covariance components Q and hyperparameters ļ¬ V = ļ¬1 Q1 + ļ¬2 Q2 Estimation of hyperparameters ļ¬ with ReML (Restricted Maximum Likelihood). Weighted Least Squares (WLS) T ļ1 ļ1 T ļ1 ˆ b ļ½ (X V X ) X V y W W ļ½V T Let ļ1 Then T T ļ1 T T ˆ b ļ½ ( X W WX ) X W Wy T ļ1 T ˆ b ļ½ (X X ) X y s s s where X s ļ½ WX , ys ļ½ Wy s WLS equivalent to OLS on whitened data and design Modelling the measured data Why? How? Make inferences about effects of interest 1. Decompose data into effects and error 2. Form statistic using estimates of effects and error stimulus function data linear model effects estimate error estimate statistic