Hello,
I am trying to calculate the residuals from an fMRI study I have
been working on to compare them with the residuals in the
ResI_****.img files that SPM generates to see if I get a match. If
they match, another of my calculations is verified so I need this proof.
I collected the beta image file data and put this in a matrices. I
then multiplied this matrices by SPM.xX.X (the raw design matrix) to
get my Y estimates. I then took the original image data (Yorig) that
I put into SPM5, collected it in a matrices, multiplied it by
SPM.xGX.gSF(1) (the scaling factor SPM5 applies) to get my Yorig
matrix. I then found the residuals by taking Res = Yorig-Yestimates.
Unfortunately, the values in Res matrix I calculated do not match
those values I pulled out of the ResI_**** image files. However, they
are quite close so I am nearly there. I am missing a calculation -
does anyone know what that calculation is?
Thanks
Todd Penney
|