python-meegkit icon indicating copy to clipboard operation
python-meegkit copied to clipboard

Q: mcca inverse transform

Open kingjr opened this issue 3 years ago • 3 comments

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!

kingjr avatar Mar 30 '21 16:03 kingjr

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:

https://github.com/nbara/python-meegkit/blob/35d79f32260569267d23368e921639b60588fed7/meegkit/cca.py#L31-L38

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)

nbara avatar Apr 02 '21 12:04 nbara

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?

kingjr avatar Apr 12 '21 10:04 kingjr

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.

nbara avatar Apr 12 '21 17:04 nbara