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

Q: mcca inverse transform #33

Open
kingjr opened this issue Mar 30, 2021 · 3 comments
Open

Q: mcca inverse transform #33

kingjr opened this issue Mar 30, 2021 · 3 comments

Comments

@kingjr
Copy link

kingjr commented Mar 30, 2021

Hi @nbara ,

Thanks for this nice package.

IIUC, mcca generate a matrix that project sensors onto canonical components.

Is there a reverse transform easily available e.g. project many subjects on canonical components, average, and project back on one?

I think this should be doable given that canonical components are orthogonal and thus invertible?

Thanks!

@nbara
Copy link
Owner

nbara commented Apr 2, 2021

Hi @kingjr, just to be sure : the use-case is denoising a single subject data based on a dataset of multiple subjects performing the same task ? If so the current code in cca.mcca() already does a big part of the job:

Returns
-------
A : array, shape=(n_channels * n_datasets, n_channels * n_datasets)
Transform matrix.
scores : array, shape=(n_comps,)
Commonality score (ranges from 1 to N^2).
AA : list of arrays, shapes = (n_channels, n_channels * n_datasets)
Subject-specific MCCA transform matrices.

Using the taxonomy in de Cheveigné et al. (2018), the MCCA code produces both summary components (SC) and canonical correlates (CC):

  • A is a transform matrix from the concatenated data to summary components (SC in the article). Summary components (SC) summarise the entire data set (and as you say SCs are orthogonal so invertible);
  • AA: array of transform matrices from each subject's individual data matrix to canonical components (CC) ; CCs are not necessarily orthogonal IIRC

So if I understand correctly what you want is essentially to take the A matrix, zero-out some weak components, and project back to sensor space?

(edited mistake)

@kingjr
Copy link
Author

kingjr commented Apr 12, 2021

Thanks @nbara.

If I follow Alain's interpretation of MCCA, it ends with a PCA, so i think the CC should be orthogonal, shouldn't they?

But yes, I'm looking for the canonical -> sensor matrix. Shall I just invert AA you think?

@nbara
Copy link
Owner

nbara commented Apr 12, 2021

Yes I think that should work.

I'm going to perform some tests soon to verify it. Will report back here when I have some results.

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