Trying to understand the lambda2 parameter in mne.minimum_norm.apply_inverse_raw

  • MNE version: e.g. 1.3.1
  • operating system: e.g. Windows 10

Hi, I am trying to conduct source localization using individual T1 MRI scan. I have done computing the forward operator and inverse operator. As I am following the tutorial Source localization with MNE, dSPM, sLORETA, and eLORETA — MNE 1.3.1 documentation, I have a question on the following snippet:

method = "dSPM"
snr = 3.
lambda2 = 1. / snr ** 2
stc, residual = apply_inverse(evoked, inverse_operator, lambda2,
                              method=method, pick_ori=None,
                              return_residual=True, verbose=True)

I am wondering how should we determine the SNR here? For noise covariance, since I am operating on resting-state EEG, I used make_ad_hoc_cov with default parameter (std = 0.2 uV for EEG). Is this related to the SNR shown above? If not, how should I determine the SNR, and the corresponding lambda2?

Thanks in advance!

Hello! This is a recurring question, and the answer – albeit maybe unsatisfactory to you – is that you should simply assume an SNR of 3 for averaged and 1 for non-averaged data:

Best wishes,
Richard

Hi Richard,

Thanks a lot for your prompt reply. I also find from Brainstorm’s documentation that SNR of 3 is a recommendation from Hämäläinen although I am still trying to locate the corresponding paper. I am also trying to look on how this SNR is being calculated, do you know if I can calculate easily by myself with the raw data?

Another problem is, as I used make_ad_hoc_cov with default parameter. When I used the raw.plot(noise_cov=noise_cov, butterfly=True) to plot the whitened data, I found that the range of amplitude fluctuation of my signal went from 40uV (before whitening) to 600uV (after whitening), I think this should be abnormal? Will you have some ideas on why this happen and what should be the normal behaviour? Thanks a lot !

Best,
Matthew

I think I kind of understand what happened. If I am setting the noise covariance to a ad-hoc matrix with 0.2uV std for each channel, essentially the whitening just divide each channel by the std, thus making the amplitude fluctuation much larger.

However, I am unsure if it is considered “normal” behaviour. In this case (resting-state EEG), shouldn’t we just compute the standard deviation of each channel, and use them to construct the noise covariance?

Try mne.compute_raw_covariance — MNE 1.6.0 documentation

ad-hoc covariance is I think mainly for cases like simulated data.

@drammock yea I also noticed this function. I think that it is suitable for MEG which can collect empty room data, or for ERP analysis as there is usually a pre-stimulus baseline. Do you think it is suitable for resting-state EEG too?

I am hesitating as I notice that there is a thread noise covariance matrix in resting state eeg data - :speech_balloon: Support & Discussions - MNE Forum which the make_ad_hoc_cov was recommended.

Ah, OK, I should have read your question more closely. I think your’e right when you say that

I think the question to ask is why do you want/need to whiten the data? If I understand correctly, using an ad-hoc covariance with default settings will not actually do any whitening (because it’s a diagonal matrix with identical values along the diagonal, so it won’t capture any actual covariance between the channels, nor will it account for differences in noise level between channels). So if you actually need the data to be whitened you’ll need to either (1) pick a “baseline” period (might be arbitrary, or maybe there are reasons to prefer early, middle, or late portions of the recording?) or (2) find some way to create an ad-hoc covariance that is at least somewhat better than the default settings (maybe by doing some cross-subject aggregation of data covariances?)

But since I’m not an expert in resting-state I think @larsoner’s comment in the other thread is the best advice:

I’m quite positive that @Denis added support for ad-hoc covariance to MNE-BIDS-Pipeline specifically to process resting-state EEG data. I’m not familiar with any theoretical underpinnings of this approach, though.

“Raw” covariance is what we use for empty-room data.

Best wishes,
Richard