Back to the main page.

Bug 3162 - beamformer noise estimation on rank-deficient covariance

Reported 2016-07-15 15:35:00 +0200
Modified 2019-08-10 12:33:01 +0200
Product: FieldTrip
Component: inverse
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P5 normal
Assigned to:
Depends on:
See also:

Sarang Dalal - 2016-07-15 15:35:58 +0200

This applies to beamfomer_lcmv and beamformer_dics, which contains the following code: if isrankdeficient % estimated noise floor is equal to or higher than lambda noise = lambda; else noise = svd(Cy); noise = noise(end); end If lambda is not specified by the user, then it defaults to zero. In the case of a rank-deficient covariance, this then sets noise to zero. (It turns out that even raw Elekta data can be rank-deficient by 1 or 2 components, which is how I ran into it.) This is not desirable behavior for my application, and I guess most users who use the noise estimate would not expect it either. It also blocks usage of the "NAI" weightnorm option, which relies on the noise estimate. I've worked around this by disabling the above code, and instead defining noise as: noise = svd(Cy); noise = noise(rank(Cy)); Shall I contribute this via Github, or would it risk an unexpected change in behavior for some?

Jan-Mathijs Schoffelen - 2016-07-18 13:51:48 +0200

Hi Sarang, It sounds like a good change to me. May I suggest something like: if isrankdeficient && (~isempty(lambda) || lambda>0) % or similar logic noise = lambda; else noise = svd(Cy); noise = noise(rank(Cy)); end ?

Jan-Mathijs Schoffelen - 2016-11-29 09:24:54 +0100

Hi Sarang, Have you followed up on this one? If so, could you close this bug? Thanks.

Jan-Mathijs Schoffelen - 2016-12-23 10:42:12 +0100

This has been resolved, with PR 275. Thanks, Sarang!

Robert Oostenveld - 2019-08-10 12:33:01 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue on