General Linear Model
General Linear Model
General Linear Model
Model
Beatriz Calvo
Davina Bristow
Overview
Summary of regression
Matrix formulation of multiple regression
Introduce GLM
Parameter Estimation
Residual sum of squares
GLM and fMRI
fMRI model
Linear Time Series
Design Matrix
Parameter estimation
Summary
Summary of Regression
Linear regression models the linear relationship between a
single dependent variable, Y, and a single independent
variable, X, using the equation:
Y = X + c +
abc x G =
Gxa+Hxb+Ixc
def H
I Gxd+Hxe+Ixf
Matrix Formulation
Write out equation for each observation of variable Y from 1 to J:
Can turn these simultaneous equations into matrix form to get a single
equation:
Y = X x +
Observed data Design Matrix Parameters Residuals/Error
General Linear Model
This is simply an extension of multiple regression
Y = X . +
Observed data: Design matrix: Parameters: Error:
= y , predicted value
= y i , true value
y = x + c = residual error
Residual Sums of Squares
Take a set of parameter estimates,
Put these into the GLM equation to obtain estimates of Y from X, i.e.
fitted values, Y :
Y =X x
The residual errors, e, are the difference between the fitted and
actual values:
e=Y-Y = Y - X
S is minimised
when the
gradient of this
Gradient = 0
curve is zero min S
parameter estimates(B)
Minimising S cont.
so to calculate the values of which gives you the
least sums of squares you must find the partial derivative
of
Which is
S/ = 2(-Xjl)(Yj Xj1 1-- XjL L)
XTY = (XTX)
when the gradient of the curve = 0, i.e. S is minimised
= XTY(XTX)-1
But a solution can only be found, if (XTX) is invertible
because you need to divide by it, which in matrix terms is
the same as multiplying by the inverse!
GLM and fMRI
How does the GLM apply to fMRI experiments?
Y = X . +
Observed data: Design matrix: Parameters: Error:
Question:
Is there any change in the
BOLD response between
moving and rest?
Time seconds
Linear Time Series Model
TIME SERIES:
consist on the sequential
measures of fMRI data signal
intensities over the period of the
experiment
N= scan number
Time
Y1
Ys
YN
Single Voxel Time Series
Model specification
The overall aim of regressor generation is to come
up with a design matrix that models the expected
fMRI response at any voxel as a linear
combinations of columns.
That is, the columns of the design matrix are the discrete
regressors
GLM and fMRI data
Consider the equation for all time points, to give a set of equations
Y1= 1 X1(t1)+ + l Xl(t1)+ + L XL(t1) + 1
= 1 + 2 +
Errors are
Time
normally and
independently
and identical
distributed
Intensity
y= x1 x2
Getting the design matrix
Observations Regressors Error
= + 2 +
1
Time
Intensity
y= 1x1 + 2x2 +
Design matrix
Observations Regressors Error
1
= x +
2
Y = X +
Design matrix
Observations Regressors Error
l L
l
l
Model is specified by:
2
Y = X + design matrix
1 Assumptions about
Y1 X1(t1) Xl L
(t1) X (t1) 1 N
Ys X1(tS) Xl(tS) XL(tS) l s
YN X1(tN) Xl(tN) XL(tN) L N
L
N N N
N: nuber of scans
P: number of regressors Y=X+
Parametric estimation
=Y-Y = Y - X
2
= +
1
+
S = tJt2
The error is minimal when
= XTY(XTX)-1
Least squares
Y X Parameter estimates
Links:
http://www.fil.ion.ucl.ac.uk/~wpenny/notes03/slides/glm/slide1.htm
http://www.fil.ion.ucl.ac.uk/spm/HBF2/pdfs/Ch7.pdf
http://www.fil.ion.ucl.ac.uk/~wpenny/mfd/GLM.ppt