Hi Gina,
I guess that V refers to the variance components that specify violations
against sphericity assumptions (unequal variances or dependencies
between observations), which are stored in SPM.xVi. The variable h
refers to the hyper-parameters associated with these variance
components.
If my guess is correct and your script creates the field I correctly in
SPM.xX then the following can be a solution to your problem:
SPM.xVi.I = SPM.xX.I;
SPM.xVi.var = sparse([0 1 0 0]); % correct for unequal variances
SPM.xVi.dep = sparse([0 1 0 0]); % correct for non-independence between
% observations
SPM.xVi = spm_non_sphericity(SPM.xVi);
The last line will create the variance components in SPM.xVi.Vi and SPM
should be able to estimate the hyper-parameters h by calling spm_reml.
You should, however, check if the structure of the variance components
fits to your assumptions of the structure of your data ("Review" ->
select SPM.mat -> "Design" --> "covariance structure").
Hope this helps,
Thilo
On Sun, 2013-12-29 at 16:38 +0000, gj wrote:
> Hi,
>
> I'm trying to fix a Matlab script to create 2nd-level F-tests that is composed of 1st-level t-tests of respective contrasts for each basis function (canonical HRF, time derivative and dispersion derivative; only one subject group) but am coming up against the following error in spm_reml.m:
>
> Error using ==> eig
> Input to EIG must not contain NaN or Inf.
>
> Error in ==> spm_reml at 202
> if min(eig(V)) < 0
>
> I didn't set V in my script (V and h are filled only with NaNs during spm_reml) , but I guess I must have not properly defined Vi?
> Any suggestions and pointers to what I might be obviously missing/what I should check would be immensely appreciated!
>
> Thanks!!
|