# Tuning Lambda^2 in High Noise Systems

**URL:** <https://mne.discourse.group/t/tuning-lambda-2-in-high-noise-systems/2047>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [January 15, 2020, 11:37pm UTC](https://mne.discourse.group/t/tuning-lambda-2-in-high-noise-systems/2047 "2020-01-15T23:37:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 15, 2020, 11:37pm UTC](https://mne.discourse.group/t/tuning-lambda-2-in-high-noise-systems/2047/1 "2020-01-15T23:37:24Z")

</div>

External Email - Use Caution

Hi All,

I have some questions about good choices for the regularization parameter  
lambda^2 in high noise systems. I?m using MNE-Python to run simulations of  
theoretical high-density solid-state MEG arrays that operate with much  
higher sensor noise than low-Tc SQUID sensors. These arrays contain a small  
number of sensors with SNRs \> 1, but the average SNR is usually \<\< 1.

I?ve been analyzing dipole localization error (DLE) and spatial dispersion  
(SD) on a resolution matrix with sensor noise injected in the middle (M @ N  
@ G, for M: inverse operator matrix, G: forward operator matrix, N: sensor  
noise matrix). I?m using MNE-Python to create my inverse and forward  
matrix.

For a given system at a given sensor noise level, my measurements of DLE  
and SD are predictably quite sensitive to choice of lambda^2. It seems that  
the recommended choice of lambda^2 = 1/avg\_snr (where avg\_snr is the  
average power snr of the system) is not close to the best choice for  
lambda^2 found through tuning.

As I sweep lambda^2 values, there is a clear minimum in the SD function  
that coincides with a knee of the curve for DLE. This seems like the right  
value to choose for optimal overall system performance. Most often, the  
tuned lambda^2 ends up being one or more orders of magnitude higher than  
the recommended value, with the scale factor increasing with more noise in  
the system.

Does using a large lambda^2 value lead to simulation results that are  
valid, or is this a numerical exercise that introduces some bias that I  
don?t yet understand? Does it make sense that the tuned value for lambda^2  
would be much larger than 1/avg\_snr for high noise systems, or is this  
likely indicating a bug somewhere?

Thanks,

Taylor Williams  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200115/c4c584af/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200115/c4c584af/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [February 3, 2020, 10:06pm UTC](https://mne.discourse.group/t/tuning-lambda-2-in-high-noise-systems/2047/2 "2020-02-03T22:06:23Z")

</div>

External Email - Use Caution

> I?ve been analyzing dipole localization error (DLE) and spatial dispersion  
> (SD) on a resolution matrix with sensor noise injected in the middle (M @ N  
> @ G, for M: inverse operator matrix, G: forward operator matrix, N: sensor  
> noise matrix). I?m using MNE-Python to create my inverse and forward  
> matrix.

You might consider using the same measures implemented in MNE directly  
nowadays, which will also give you some possibly complementary information:

[https://mne.tools/dev/generated/mne.minimum\_norm.resolution\_metrics.html#mne.minimum\_norm.resolution\_metrics](https://mne.tools/dev/generated/mne.minimum_norm.resolution_metrics.html#mne.minimum_norm.resolution_metrics)

For a given system at a given sensor noise level, my measurements of DLE

> and SD are predictably quite sensitive to choice of lambda^2. It seems that  
> the recommended choice of lambda^2 = 1/avg\_snr (where avg\_snr is the  
> average power snr of the system) is not close to the best choice for  
> lambda^2 found through tuning.
> 
> As I sweep lambda^2 values, there is a clear minimum in the SD function  
> that coincides with a knee of the curve for DLE. This seems like the right  
> value to choose for optimal overall system performance. Most often, the  
> tuned lambda^2 ends up being one or more orders of magnitude higher than  
> the recommended value, with the scale factor increasing with more noise in  
> the system.

In addition to testing some other metrics (above), you could also try  
looking to see if there is any relationship to the estimated SNR like in:

[https://mne.tools/dev/auto\_examples/inverse/plot\_snr\_estimate.hhttps://mne.tools/dev/auto\_examples/inverse/plot\_snr\_estimate.htmltml](https://mne.tools/dev/auto_examples/inverse/plot_snr_estimate.hhttps://mne.tools/dev/auto_examples/inverse/plot_snr_estimate.htmltml)  
\<[https://mne.tools/dev/auto\_examples/inverse/plot\_snr\_estimate.html&gt](https://mne.tools/dev/auto_examples/inverse/plot_snr_estimate.html&gt);

And you could follow related citations for these functions/methods:

[https://mne.tools/dev/generated/mne.minimum\_norm.estimate\_snr.html#mne.minimum\_norm.estimate\_snr](https://mne.tools/dev/generated/mne.minimum_norm.estimate_snr.html#mne.minimum_norm.estimate_snr)  
[https://mne.tools/dev/generated/mne.SourceEstimate.html#mne.SourceEstimate.estimate\_snr](https://mne.tools/dev/generated/mne.SourceEstimate.html#mne.SourceEstimate.estimate_snr)

Does using a large lambda^2 value lead to simulation results that are

> valid, or is this a numerical exercise that introduces some bias that I  
> don?t yet understand? Does it make sense that the tuned value for lambda^2  
> would be much larger than 1/avg\_snr for high noise systems, or is this  
> likely indicating a bug somewhere?

I am not sure. It might also be worth (reading this and) pinging the  
authors of this paper separately as they might have ideas, and I'm not sure  
how actively they monitor the list:

> **[EEG/MEG Source Estimation and Spatial Filtering: The Linear Toolkit](https://link.springer.com/referenceworkentry/10.1007/978-3-030-00087-5_85)**
>
> The choice and application of EEG/MEG source estimation methods require an understanding of their underlying modeling assumptions as well as tools to evaluate their spatial resolution and localization performance. Linear methods are the most popular...

Best,  
Eric  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200203/606b65cd/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200203/606b65cd/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [February 12, 2020, 1:23pm UTC](https://mne.discourse.group/t/tuning-lambda-2-in-high-noise-systems/2047/3 "2020-02-12T13:23:04Z")

</div>

External Email - Use Caution

hi Taylor,

sorry for the late reply.

Tuning lambda (or generally hyperparameters) in inverse problems is a  
known challenge.  
The MNE recommendation has shown to be a sensible default but surely  
would be optimized  
for certain studies / systems. Various strategies exist to do this:  
cross-validation, "Bayesian  
Ridge", L-Curve etc.

do not hesitate to share your experimental findings here.

Alex
