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

Possibly flawed calculation of VARICA #181

Open
cbrnr opened this issue Sep 13, 2016 · 5 comments
Open

Possibly flawed calculation of VARICA #181

cbrnr opened this issue Sep 13, 2016 · 5 comments

Comments

@cbrnr
Copy link
Contributor

cbrnr commented Sep 13, 2016

Most ICA algorithms whiten the input data as a first step, otherwise they do not work optimally. We're using Infomax from MNE-Python, and this function expects the input data to be white (see mne-tools/mne-python#3526). We're applying this function directly to the residuals, which need not necessarily be white. I think a whitening step before ICA is mandatory here. (Note: we do have an option to perform PCA on the input data, which is not relevant in this case because we're applying ICA to the model residuals).

The plainica function does include a PCA step (although this is only decorrelation and not whitening) - the option no pca doesn't seem to make sense in this context.

When using FastICA, this problem doesn't seem to be relevant, because the FastICA implementation in sklearn whitens the data by default.

@mbillingr any thoughts?

@mbillingr
Copy link
Member

I don't know... What does it mean that the ICA needs whitened input data, anyway?

  • Does it mean that time samples should be uncorrelated? This is the case if the VAR model adequately fits the data.
  • Does it mean that the signals should be uncorrelated, as in PCA + scaling?
  • Or is it nothing as simplistic?

When it is clear what exactly should be done before performing the ICA we could just implement this whitening step and compare results.

@cbrnr
Copy link
Contributor Author

cbrnr commented Nov 10, 2016

I think it means PCA plus scaling. The scikit-learn implementation of PCA has a whiten argument for this (which is False by default). I was trying to implement the whitening step in our PCA implementation, but so far I didn't succeed. Maybe you could take a look at the relevant code?

Alternatively, we could just use the scikit-learn implementation when switching to this backend. But we need a fallback implementation, and since ICA requires whitened data I'm afraid there's no way around implementing this ourselves.

@mbillingr
Copy link
Member

For testing the sklearn implementation should be sufficient.

What was the problem in implementing the whitening step? I'd naively assume that it is just a matter of multiplying each component by its inverse standard deviation.

@cbrnr
Copy link
Contributor Author

cbrnr commented Nov 17, 2016

Somehow whitening never works although it should work as you suggest. I can't remember what the problem was, but I'd be happy if you could take a look at the current PCA implementation and suggest how to add whitening (ideally as an optional parameter).

@mbillingr
Copy link
Member

Ok.. give me a few more days, please.

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

No branches or pull requests

2 participants