Hi all,

Following up on a discussion from office hours last weekâ€¦ Iâ€™m hoping someone can confirm/clarify my understanding of how MNE-python handles rank deficiencies in (MEG) covariance estimation for minimum-norm estimates, when using the default `rank = None`

in `mne.compute_covariance`

. This is what I understand from looking at `_compute_covariance_auto`

and `_smart_eigh`

in `mne.cov`

:

If the data matrix (X) used to estimate `cov`

is rank deficient, then `_smart_eigh`

will eigendecompose the matrix X^{T}X and get projections to a subspace defined by the eigenvectors with non-zero eigenvalues (this is done in `_get_ch_whitener`

). The data that are to be used for estimation are then projected into this space, effectively eliminating the redundant rows in the matrix and concerns about rank deficiency. The covariance matrix which is ultimately returned is estimated in this subspace, regardless of whether or how regularization is applied, and then projected back to the original space at the end of `_compute_covariance_auto`

.

Does this sound correct or have I missed something here? Thanks!

FWIW:

- MNE-Python version: 0.23.0
- operating system: macOS

The relevant part of the code: mne-python/cov.py at maint/0.23 Â· mne-tools/mne-python Â· GitHub