Hi Thomas,
Thank you very much for the explanations, they make sense. There is
however one thing that I don't get. For time point 2 of the time-series,
there are only 1 time point before and 5 time points afterwards which
are much different from zeros, so should the 2nd element of the
whitening filter not also be significantly larger than the other
elements of the filter (with the exception of element 1). Or do only 3
elements contribute to the whitening of the time series (1 before, 1
time point, and 1 afterwards, so a total of 3), in which case only the
first (and last) element of the whitening filter need to be larger?
Thank you very much,
~ Cedric
-----Original Message-----
From: SPM (Statistical Parametric Mapping) [mailto:[log in to unmask]]
On Behalf Of Thomas E. Nichols
Sent: Sunday, December 12, 2004 5:38 PM
To: [log in to unmask]
Subject: Re: [SPM] spm_filter
Cedric,
> When using the function spm_filter, I noticed that I get a huge
> spike for the first and last point in the filtered output
> signal. The rest of the time-series looks ok. This is specifically
> the case when I use the following:
>
> signal_out=spm_filter(SPM.xX.K,SPM.xX.W*signal_in);
>
> where signal_in is just a time-series extracted from the fMRI data
> set.
>
> It seems to be the whitening filter that causes this, because when I
> leave SPM.xX.W out, the output signal looks ok. But the whitening
> filter should not do this, right?
I've noticed this too, and was at first quite disturbed. But it turns
out it is just an artifactual, but anticipated edge effect. Here is
my understanding:
For a timepoint k=n/2 in the middle of the time series, there are,
say, maybe, 5 time points before and 5 points after which contributed
to the whitening of time series (i.e. W(k,:) has 5+1+5=11 elements
that are appreciably different from zero). But for timepoint 1,
assuming a stationary ACF, there will only be 5 time points afterwards
which are much different from zero. Thus, the whitened first
observation is a linear combination of 6 observations, while the
whitened k'th observation is a linear combination of 11 observations.
But we expect that the variance of the original observations is
constant (Var(Y_i) is homogeneous) and we require that the variance of
the whitened observations be constant (Var((W*Y)_i) is homogeneous),
hence the magnitudes of the 6 non-zero elements of W(1,:) must be
larger than the 11 non-zero elements of W(k,:); specifically, their
sums of squares must be equal.
Put another way, the whitening filter is designed to preserve the
variance of each observation. But a variance preserving filter
doesn't necessarily preserve the mean, and it doesn't here. But this
isn't a problem b/c we whitened the data *and* the model
W*Y = W*X*beta + W*epsilon
So, yes, we expect that the ends of the whitened signal will get blown
up, due to edge effects. But this isn't a problem since the whitened
model also has this same effect.
This issue comes up in model diagnosis, and how to identify problem
scans. The assumptions are made on the whitened errors, and so it is
natural to diagnose the whitened residuals. But the whitened
residuals are a (possibly complicated) linear combination of the
original data, and hence a poor choice for identifying individual
problem scans. In SPMd, we currently diagnose whitened residuals (and
so see the same edge effects you see), but we're building
functionality so you can flip back and forth between whitened and
unwhitened residuals.
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
|