Todd,
> I am not really understanding how the K matrix (residual forming
> matrix) is created in SPM5. This matrix is supposed to be used to
> multiply by Y, the fMRI observations, to account for confounds like
> scanner drift. According to the spm_spm help, K is a structure and
> I don't really understand what is happening in spm_filter to modify
> Y with K. I know you can't multiply a structure by a matrix - can
> anyone help out?
SPM.K is not, itself, the residual forming matrix. It is a struct
array that describes how to model the drift for each session
(e.g. K(1) for session 1, K(2) for session 2).
K.X0 is is the drift basis; you can see it being applied on line 60 of
spm_filter.m. Note, because it is orthonormal inv(X0'*X0) = I. If it
weren't orthonormal, that line would would look like
y = y - X0 * inv(X0'*X0)*X0'y
or, using the pseudoinverse
y = y - X0 * pinv(X0)*'y
I've sometimes thought it would be nice to make X0 a generic holder of
all nuisance variables that you don't want to see displayed as part of
the design matrix. However, because X0 is assumed to be orthonormal,
you can't just tack stuff on (or, if you do, you have re-orthogonalize
and normalize it with orth.m).
Hope this helps.
-Tom
-- Thomas Nichols -------------------- Department of Biostatistics
http://www.sph.umich.edu/~nichols University of Michigan
[log in to unmask] 1420 Washington Heights
-------------------------------------- Ann Arbor, MI 48109-2029
|