Skip to content

ENH: Ditching regularization - beamformer with rank-based inversion of cov matrix #5362

Closed

Description

@britta-wstnr

We have been experimenting with @sarangnemo with a beamformer variant that does not require the setting of a regularization parameter. Instead of regularizing the covariance matrix, it estimates the rank of the covariance matrix and sets the number of rank-deficient components to zero during the inversion of the covariance matrix. Thus, the enhancement of this method is that there is no "guessing" of the regularization parameter involved.

So far, we got very good results with this, especially also on highly rank-deficient data like maxfiltered data.

A branch of my fork of MNE-Python with this beamformer variant implemented can be found here:
https://github.com/britta-wstnr/mne-python/tree/lcmv_cov_inv

And see here for the enhanced beamformer API (parameter eig_inv added to enable this variant):
https://github.com/britta-wstnr/mne-python/blob/lcmv_cov_inv/mne/beamformer/_lcmv.py#L26

I would be happy to make this a PR if there is an interest in that!

Activity

  1. larsoner commented on Jul 24, 2018

    @larsoner
    Member

    We do an operation like this for the whitening step in minimum norm inversion. It involves use of an optional rank parameter. It would be great if you could reuse code there as much as possible to do this. And it sounds like a great way to make the two operations have more similar options.

  2. agramfort commented on Jul 24, 2018

    @agramfort
    SponsorMember

    yes we should do this by default. as @larsoner says it's what is done in MNE/dSPM during the withening step.

    cc @vlitvak who suggested the same thing.

    we have our phantom data to test this.

  3. britta-wstnr commented on Jul 26, 2018

    @britta-wstnr
    MemberAuthor

    so far, I implemented it from scratch to be able to easily play around with it, if it goes into MNE-Python we should of course refactor! So thanks for the hints, I will look into it!

  4. wmvanvliet commented on Aug 22, 2018

    @wmvanvliet
    Contributor

    It seems like a no-brainer to me to replace this ugly hardcoded regularization in the current beamformer implementation:

    Wk[:] = np.dot(linalg.pinv(Ck, 0.1), Wk)
    

    with your approach @britta-wstnr.

  5. agramfort commented on Aug 23, 2018

    @agramfort
    SponsorMember
  6. added this to the 0.17 milestone on Oct 4, 2018
  7. larsoner commented on Nov 5, 2018

    @larsoner
    Member

    We plan to unify in 0.18 now

  8. modified the milestones: 0.17, 0.18 on Nov 5, 2018
  9. modified the milestones: 0.18, 0.19 on May 13, 2019
  10. removed this from the 0.19 milestone on Sep 11, 2019
  11. larsoner commented on Feb 19, 2021

    @larsoner
    Member

    I think we have this now, reg=0 gives sensical results in the tests at least I think.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions