0357 %20070926, Regress some covariables out first
0358 %Result =( E - X(X'X)~X')Y
0359 [nDim1, nDim2, nDim3, nDim4]=size(ABrain4D);
0360
0361 %Make sure the 1st dim of ABasisFunc is nDim4 long
0362 ifsize(ABasisFunc,1)~=nDim4, error('The length of Covariables don''t match with the volume.'); end
0363
0364 % (1*sampleLength) A matrix * B matrix (sampleLength * VoxelCount)
0365 ABrain4D =reshape(ABrain4D, nDim1*nDim2*nDim3, nDim4)';
0366 Result =(eye(nDim4) - ABasisFunc * inv(ABasisFunc' * ABasisFunc)* ABasisFunc') * ABrain4D;
0367 %20071102 Bug fixed squeeze must not be excluded because nDim1 may be ONE !!!
0368 %Result =squeeze(reshape(Result', nDim1, nDim2, nDim3, nDim4));
0369 Result =reshape(Result', nDim1, nDim2, nDim3, nDim4);
0370
0371 function Result =Brain1D_RegressOutCovariables(ABrain1D, ABasisFunc)
0372 %20070926, Regress some covariables out first
0373 %Result =( E - X(X'X)~X')Y
0374 %Make sure the input is a column vector
0375 % ABrain1D =reshape(ABrain1D, prod(size(ABrain1D)), 1);
0376
0377 %Make sure the 1st dim of ABasisFunc is nDim4 long
0378 ifsize(ABasisFunc,1)~=length(ABrain1D), error('The length of Covariables don''t match with the volume.'); end
0379
0380 % (1*sampleLength) A matrix * B matrix (sampleLength * VoxelCount)
0381 Result =(eye(size(ABrain1D, 1)) - ABasisFunc * inv(ABasisFunc' * ABasisFunc)* ABasisFunc') * ABrain1D;
Submitted by admin on Wed, 12/25/2013 - 23:46 Permalink
Re: 去除协变量
One is for voxel-wise, the other is for ROI-wise.
0356 function Result =Brain4D_RegressOutCovariables(ABrain4D, ABasisFunc)
Submitted by wangjingjuan on Thu, 12/26/2013 - 09:02 Permalink
Re: 去除协变量
我看那个公式,去除方法是线性回归。但是脑脊液白质信号间并不独立,这个方法是不是欠妥呢
Submitted by ZangYF on Thu, 12/26/2013 - 16:25 Permalink
Re: 去除协变量
许多多元线性回归存在着这个问题。实际上,头动的6个参数之间恐怕更加不独立,全脑平均时间序列与其它时间序列也不独立。我也不知道这种情况下对结果会造成什么影响。但我个人觉得,每个协变量,在不清楚其影响的情况下,都不应该随意加进去。这些参数还好,都是大家常用的,有些人加更多更多的协变量。
Submitted by ZHANG_RESTadmin on Fri, 12/27/2013 - 08:33 Permalink
Re: 去除协变量
从数学上看,属于最小二乘估计,只要去掉covariates共同张成的子空间里的信息就可以。如果找到独立的脑脊液的信号和白质的信号,很可能两者张成的子空间和直接做所张成的没有太大区别。在spm里做激活区检测的时候,要做非球形校正,但是那也只是保证不相关,而不是独立。
Submitted by ZHANG_RESTadmin on Fri, 12/27/2013 - 08:33 Permalink
Re: 去除协变量
从数学上看,属于最小二乘估计,只要去掉covariates共同张成的子空间里的信息就可以。如果找到独立的脑脊液的信号和白质的信号,很可能两者张成的子空间和直接做所张成的没有太大区别。在spm里做激活区检测的时候,要做非球形校正,但是那也只是保证不相关,而不是独立。