How to handle unstable mixing matrix estimation warning when using ICA.fit()

  • MNE-Python version: 0.24
  • MAC OS 11.6.1

I’m encountering a warning when attempting to fit my ica to my raw data. I have a 10-minute EEG recording consisting of 46 channels with sampling rate 250 Hz.

I’ve tried to use the syntax given under the API reference for ICA.

import mne
from mne.preprocessing import ICA
raw = mne.io.read_raw_edf('myfile.edf',preload=True)
raw_filt = raw.filter(l_freq=1, h_freq=None)
ica = ICA(method='fastica',n_components=.999999, random_state=6,max_iter="auto")
ica.fit(raw_filt)

In the fitting step, I receive the following warning:

> RuntimeWarning: Using n_components=0.999999 (resulting in n_components_=6) may lead to an unstable mixing matrix estimation because the ratio between the largest (46) and smallest (2.2e-05) variances is too large (> 1e6); consider setting n_components=0.999999 or an integer <= 5

I’m not sure how to address this, particularly since I’ve followed the suggestion and set n_components=.999999 . I observed that setting n_components=5 did not produce a warning, but I’m not sure why.

Also, do I apply the fit to the original raw data or the filtered version?

`