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

code ideas from Simon Musall / Anne Churchlands 2019 Paper #79

Open
behinger opened this issue Nov 18, 2019 · 0 comments
Open

code ideas from Simon Musall / Anne Churchlands 2019 Paper #79

behinger opened this issue Nov 18, 2019 · 0 comments

Comments

@behinger
Copy link
Member

behinger commented Nov 18, 2019

uf_vif


rejIdx = false(1,size(fullR,2));
[~, fullQRR] = qr(bsxfun(@rdivide,fullR,sqrt(sum(fullR.^2))),0); %orthogonalize normalized design matrix
figure; plot(abs(diag(fullQRR)),'linewidth',2); ylim([0 1.1]); title('Regressor orthogonality'); drawnow; %this shows how orthogonal individual regressors are to the rest of the matrix
axis square; ylabel('Norm. vector angle'); xlabel('Regressors');
if sum(abs(diag(fullQRR)) > max(size(fullR)) * eps(fullQRR(1))) < size(fullR,2) %check if design matrix is full rank
    temp = ~(abs(diag(fullQRR)) > max(size(fullR)) * eps(fullQRR(1)));
    fprintf('Design matrix is rank-defficient. Removing %d/%d additional regressors.\n', sum(temp), sum(~rejIdx));
    rejIdx(~rejIdx) = temp; %reject regressors that cause rank-defficint matrix
end

This might give additional diagnostics for collinear predictors (haven't thought through the maths of this one)

uf_glmfit

Take their regularisation strategy, which allows each column to have their own lambda-regularisation parameter (MIT License, so we can include it & modify it)
https://github.com/churchlandlab/ridgeModel/blob/master/ridgeMML.m

EDIT: Turns out, I missread. This allows a different lambda parameter for each column of Y, not of X.
Thus it is not as useful as I was hoping. It is very fast, but unfortunately cannot work with sparse matrices.

Secondedit: I still think having separate lambda parameters for each columns (or at least blocks of columns) would be great. Maybe I am missing something. One wayto manually do it, would be to add diagonal matrices to the designmatrix and predict "0", this is a GLM way to shrink.

other ideas

They report things that should be relatively easy in unfold (once we have crossvalidation):

  • crossvalidated $R^2$
  • unique-variance (i.e. a kind of $R^2_{predictor}$, SS_{Full} - SS_{withoutx_i} / SS_{Full}

But importantly all of these things work on single subject level, not on group level. I.e. we still have to give some tips to do an ANOVA on grouplevel. But I actually right now think that is easy.

For group-level t-test, we test whether a single beta is different to 0. For a group of betas, we can use an ANOVA (and permuted ANOVAS). It is my understanding that thisis the same as in SPM. I think this should be straight forward to include in the development version of the statistics function using TFCE.

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

1 participant