Hi,
I have recently been asked a few times about the error that some
people are getting in SPM2 when estimating the covariance components
via ReML. The error is:
Temporal non-sphericity (over voxels) : ...REML estimation
Warning: Divide by zero.
(Type "warning off MATLAB:divideByZero" to suppress this warning.)
>> In c:\spm2\spm_spm.m at line 772
ReML Block - 1
??? Index exceeds matrix dimensions.
Just for reference, this error occurs because the non-sphericity was
inestimable and the non-sphericity structure xX.V is rank deficient -
see this email for more detail:
http://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=ind04&L=SPM&P=R460237&I=-3
If anyone is getting this error, I would personally suggest edting
your spm_spm.m file in SPM2, and, just after these lines, (round line
418 in my version):
% otherwise make W a whitening filter W*W' = inv(V)
%-------------------------------------------------------
[u s] = spm_svd(xVi.V);
you should add:
% Check for failure of whitening
if size(s, 1) < nScan,
error(['Autocovariance estimation poorly conditioned;' ...
'reduce model or increase number of
observations?']);
end
That is obviously just to give you a more helpful warning message.
One reason for this error, for FMRI fixed effects analyses, is that
SPM2 makes very strong assumptions about the autocorrelation.
Specifically SPM assumes that, by default, after filtering, the
autocorrelation is an AR(1) process where the coefficient (rho) of the
AR(1) is around 0.2. In practice, if the actual AR coefficient is
above 0.3 or below 0.1, the default model will not do a good job of
estimating the autocorrelation. This can happen for example with
faster (short TR) scanning, where there may be higher autocorrelation
(higher rho coefficient)
To avoid the error, you can:
1) use the more advanced stuff in SPM5, apparently
2) Try and change the model - including trying to change the
parameters used for AR modelling for FMRI at the first level
http://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=ind03&L=SPM&P=R249623&I=-3
3) consider not using the non-sphericity correction at the first level
- this may reduce power at the second level, but the effect may be
slight compared to the inter-subject variance. It may also avoid bias
from an incorrect autocorrelation model at the first level.
4) Try a different calculation method for AR modelling at the first
level. In fact, this is what I ended up implementing for MarsBaR:
http://marsbar.sourceforge.net/faq.html#fmristat
It would in principle be fairly easy to add this option to SPM, but I
have never got round to it. In case there is anyone out there
interested in doing it, I have appended some pointers I sent out in a
previous reply to Bas Neggers about this.
Best,
Matthew
In MarsBaR I put in an option to use Keith Worsley's simple AR
estimation - which is only useful for the fMRI first-level analyses,
but is more robust, and does not rely on a hard-coded estimate of the
autocorrelation. It would be fairly simple to port over to SPM, I
just haven't had the time. If anyone is interested, the code is here:
[log in to unmask]" target="_blank">http:[log in to unmask]
The function above is just a modified version of spm_spm, and it may
be simple to see how to change the relevant bits of spm_spm to get the
same effect. You'll see that MarsBaR uses some unmodified copies of
spm functions, which have a 'pr_' prepended - such as 'pr_spm_reml.m'
which is identical to 'spm_reml.m'. The autocovariance changes in the
above function are especially lines 291 to 331. The actual estimation
is done by:
[log in to unmask]" target="_blank">http:[log in to unmask]
|