Thanks for the comments Cyril and Vadim,
(I'm posting this thread back on the listserv for those who might be interested.)

First, I would NOT put two columns of ones. If no regressor is specified, SPM automatically includes the intercept, which makes things easy.

Second, I understand that a scaling factor is estimated in SPM.xY.VY during model estimation, but I don't understand how exactly this is computed and what it represents besides that it works as a global scaling factor to make the average intensity 100 (default).

In any case, I'm mainly interested in the relative intensity across different TRs over multiple voxels (like temporal correlations), and this is why filtering and AR correction is important. So, for this purpose, I'm thinking that it should not matter how the residuals are scaled? Please correct me if I'm wrong.

Joon


On Thu, Jul 23, 2009 at 7:27 AM, Vadim Axel <[log in to unmask]> wrote:
Cyril,
Consider the simple case that I load my Y as raw data directly from my *.nii files. However, in the estimation SPM uses SPM.xY.VY, which is not the intensity of the original *.nii data. Concequernly, you r would be uncomparable to original Y intensity. Isn't it?
Vadim (not Axel:)


On Thu, Jul 23, 2009 at 1:28 PM, cyril pernet <[log in to unmask]> wrote:
Axel

not sure to follow here .. as mentioned earlier the residuals will be without the mean (or intercept as you want) but they are r = Y-Yhat and Yhat = Beta*X with X the matrix with the drift and high pass filter  + AR included in the estimation of the Beta via the whitening matrix W Betas = inv(X'*W*X)*X'*Y (in W there is also a regularization bit --> * c = a very small number) -- but what is K? where do you scale?

c

Hi guys,

Indeed very interesting idea. However, I am missing something: there is always last "white" column with "1", which SPM adds in order that the model will contain intercept. So, now we will two one columns like this (the first is our regressor). Is it OK?
In addition, the residiuls which we will get, I believe, would be with some scaling factor (K),which SPM apllies. So, it would be difficult quantatively to measure to what extent the signal have changed at each time point, but only to run the correlation between two signals. Correct?

Thanks,
Vadim

On Thu, Jul 23, 2009 at 12:43 PM, cyril pernet <[log in to unmask] <mailto:[log in to unmask]>> wrote:

   Joonkoo

       I want to take the "raw signal" and then apply detrending
       (e.g. highpass
       filtering at 128Hz) and temporal autocorrelation correction
       (e.g. using
       AR(1) model) just as how ordinary SPM procedure does. I
       searched for a
       script or a thread concerning this issue, but unfortunately I
       wasn't able to
       find a good advice on this.
       So I came up with one idea which is to use the conventional
       SPM model
       estimation procedure *without* any regressor specified. This
       way, the model
       matrix will only include the grand mean (column of ones) for
       each run. The
       residuals from this estimation should, in theory, give me the
       "highpass
       filtered" and "temporal autocorrelation corrected" which is
       further mean
       centered for each run.  
   sounds good to me - change in spm_defaults the residual number to
   'inf' and in spm_spm comment the bit which actually delete the
   residuals from the disk - also in the design matrix you can enter
   the txt file from the realignment ; residuals here = data with
   variance related to motion removed + filtered as you wanted :-)
    (note the filtering is high pass / AR ~ = low pass / drift) --
   also the mean will have been removed (that the contant term in the
   design matrix)

   Cyril


   --    The University of Edinburgh is a charitable body, registered in
   Scotland, with registration number SC005336.




--
Dr Cyril Pernet,
fMRI Lead Researcher SINAPSE
SFC Brain Imaging Research Center
Division of Clinical Neurosciences
University of Edinburgh
Western General Hospital
Crewe Road
Edinburgh
EH4 2XU
Scotland, UK tel: +44(0)1315373661
http://www.sbirc.ed.ac.uk/cyril
http://www.sinapse.ac.uk/



The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.