Hi Allison,
See lines 173-176 of spm_spm.m and line 149 of spm_graph.
xX.Bcov is not actually Bcov (slightly misleading name, but hey...),
it needs to be multiplied by the residual mean square (ResMS), which
explains the factor of 50 difference you observe.
Basically, I think what is happening is that the covariance of b_hat
in the GLM y=Xb+e, e~N(0,C), is inv(X'inv(C)X), but SPM factors C into
a spatially-stationary temporal non-sphericity V, and a
spatially-varying temporally-stationary variance s (ResMS), i.e.
C=s(at current voxel)*V and then the covariance of b_hat is
s*inv(X'inv(V)X) or ResMS*xX.Bcov.
I think SPM deals with something more complicated than my
inv(X'inv(C)X) using generalised inverses to allow for singular X, but
the basic idea is the same. I hope...
Best,
Ged.
Nugent, Allison C. (NIH/NIMH) [E] wrote:
> Hello all – this is a repost of a question I really need answered…
>
>
>
> I'm in the process of writing a script to calculate the variance and
>
> standard error of the parameter estimates (betas). Much like this
>
> previous post:
>
>
>
> http://www.jiscmail.ac.uk/cgi-bin/wa.exe?A2=ind01&L=SPM&P=R326834&I=-3 <http://www.jiscmail.ac.uk/cgi-bin/wa.exe?A2=ind01&L=SPM&P=R326834&I=-3>
>
>
>
> I've run into one thing I don't understand. I can retrieve the beta
>
> covariance matrix from the SPM file - SPM.xX.Bcov. However, when I use
>
> the plot function when looking at the results, the Bcov matrix is also
>
> written to the matlab workspace. However, the matrices do not agree -
>
> they are off by a factor of 50. The workspace Bcov, multiplied by 50, is
>
> equal to SPM.xX.Bcov.
>
>
>
> What is the reason for this discrepancy, and which should I use when
>
> calculating the variance?
>
>
>
>
>
> Thanks in advance!
>
>
>
>
>
> Allison Nugent
>
> MRI Physicist
>
> SNMAD/MIB/NIMH/NIH
>
> Office: (301)451-8863
>
> Mobile: (301)408-8560
>
> [log in to unmask]
>
>
>
|