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

s1 variable missing in peerPC_cov.m #1

Open
RobertoDF opened this issue Mar 10, 2021 · 1 comment
Open

s1 variable missing in peerPC_cov.m #1

RobertoDF opened this issue Mar 10, 2021 · 1 comment

Comments

@RobertoDF
Copy link

Hi!

Thanks for making all the code available. I have a problem using peerPC_cov.m, where is the s1 variable from?
I tried the second output of svdecon but it doesn't work....

cpc = corr(gather_try(s1(1,:)'), gather_try(Ff(ntrain,itest)' * u2(:,1)));

@RobertoDF
Copy link
Author

RobertoDF commented Mar 10, 2021

Looking around I found s1 defined in the SVCA function:

function [sneur, varneur, u, v, noise] = SVCA(Ff, npc, ntrain, ntest, itrain, itest)
cov = Ff(ntrain,itrain) * Ff(ntest,itrain)';
[u,~,v] = svdecon(cov);
u = u(:,1:npc);
v = v(:,1:npc);
s1 = u' * Ff(ntrain,itest);
s2 = v' * Ff(ntest,itest);
sneur = sum(s1 .* s2, 2);
varneur = sum(s1.^2 + s2.^2,2)/2;

If I add this definition of s1 to peerPC_cov.m the code seems to run fine but is everything correct?

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