Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The new noiseNormalizeBeta.m does not always work due to counting in confound regressors #35

Open
tammandres opened this issue Nov 11, 2018 · 1 comment

Comments

@tammandres
Copy link

tammandres commented Nov 11, 2018

Dear Developers

I tried to use the new version of noiseNormalizeBeta.m (https://github.com/rsagroup/rsatoolbox/blob/develop/%2Brsa/%2Bspm/noiseNormalizeBeta.m) on single-trial neural activation pattern estimates.

For some subjects, the function returned complex valued numbers. This seems to be because the updated function uses the mean variance of all betas--including motion regressors--to scale the degrees of freedom, as in the statement "SPM.xX.trRV/(Nrun*mean(diag(SPM.xX.Bcov)))" on line 85. In my data, motion regressor estimates of some subjects had extremely high variance, which led to degrees of freedom scaled close to zero and to no shrinkage being applied by the covdiag() function.

I wonder if scaling with the variance of all betas (including motion regressors) was intended as the parameter vectors of confound regressors are usually not of interest for multivariate noise normalisation? In my data, I could bypass this issue by excluding motion regressors from Bcov.

Many thanks and best wishes
Andres

@avrvaidya
Copy link

Hi RSA Toolbox Team,

I'd like to second Andres's concern about the new version of noiseNormalizeBeta. The new (October, 2018) version of this function returns complex values for the betas. However, this problem wasn't resolved for me by removing the motion regressors from the Bcov matrix like Andres suggested.

I reverted the code to the prior version from 2015 and found that it gave much more sensible output for the betas, but was still returning complex numbers in some cases.

When I took a look at the eigenvalues for the covariance matrix that came from the 'covdiag' function, I noticed that they were very small and negative, so I suspected that something was probably wrong with the shrinkage method.I stuck the covariance shrinkage function from the Decoding Toolbox (Hebart and Gorgen) in place of covdiag. This seems to have fixed the problem as eigenvalues of the covariance matrix are all positive, non-zero. The results are highly correlated with those using RSA Toolbox with the 2015 version of noiseNormalizeBeta, but without the odd complex value output.

I hope someone in the development team can take a look at this and see what the problem is. Otherwise, this seems like a reasonable hack for the moment.

Thanks a lot,
Avi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants