<div dir="ltr">Thanks a lot Alex and Denis, very helpful. <div>Denis, yes, I was using the three options as you suggested but then it occurred to me that my old guessed regularisation is somehow performing better for my data (I&#39;m using plain MNE for source estimation), then checked the code and saw that the defaults for fixed diagonal is different and thought this might be the reason.</div><div>I guess smaller values are usually better but will check the whitened data and returned estimators to see why it may not be the case for my data.</div><div><br></div><div>Many thanks,</div><div>Rezvan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 10, 2015 at 9:58 AM, Denis-Alexander Engemann <span dir="ltr">&lt;<a href="mailto:denis.engemann@gmail.com" target="_blank">denis.engemann@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Sorry for coming late, and hi Rezvan,<div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, Dec 10, 2015 at 10:22 AM, Alexandre Gramfort <span dir="ltr">&lt;<a href="mailto:alexandre.gramfort@telecom-paristech.fr" target="_blank">alexandre.gramfort@telecom-paristech.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>hi,<br>
<br>
&gt; This is probably a dummy question but to assemble the inverse operator in<br>
&gt; the older versions of mne_python, one had to first compute the noise<br>
&gt; covariance then regularize it manually by assigning mag grad and eeg<br>
&gt; regularisation factors. the defaults are 0.1 here.<br>
<br>
</span>correct. You can still do this. Although when working on this with<br>
Denis we realized<br>
that the 0.1 value is typically too high. This leads to smaller<br>
whitened data and for example weaker dSPM/sLORETA values.<br>
<span><br>
&gt; At the moment the automated paradigm computes the noise covariance and<br>
&gt; regularizes in the same framework by cross-validation. the defaults of<br>
&gt; regularisation factors for empirical approach and fixed diagonal are much<br>
&gt; less than the old ones (0.01, 0.01 and 0.0 for grad, mag and eeg<br>
&gt; respectively).<br>
<br>
</span>when doing cross-validation the parameters are optimized for your data.<br>
<br>
you can use the evoked.plot_white method to check your whitening quality.<br>
<span><br></span></blockquote><div><br></div></span><div>The whole idea is that here we cannot know in advance what is the best. You improve your chance of getting closer to the optimal solution by using different regularization strategies. I would recommend you to also use &#39;shrunk&#39;, it will in fact learn use a grid search to determine the best regularization values and then is compared against other solutions. So far with &#39;diagonal_fixed&#39; no tuning is involved, same for &#39;empricial&#39;. A minimal and fast way of optimizing reguralization would be [&#39;empricial&#39;, &#39;diagonal_fixed&#39;, &#39;shrunk&#39;] where you pass your guess for diagonal_fixed to the method_params, e.g.</div><div><br></div><div>method_params=dict(diagonal_fixed=dict(<span>grad</span><span>=</span><span>0.01</span><span>,</span><span> mag</span><span>=</span><span>0.01</span><span>,</span><span> eeg</span><span>=</span><span>0.0</span><span>))</span></div>







<div><br></div><div>This way you can compare no regularization, your guess and the grid search. The function will return you the covariance estimator that fits best unseen data. If you set `return_estimators` to True you will get a list ordered by fit. You can then pass this to evoked.plot_white and inspect model violations for your estimators as Alex pointed out.</div><span class=""><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>
&gt; I had a look at the new cov.py code to see if can see some scalings that<br>
&gt; could explain why the new regularisation uses smaller defaults but seems<br>
&gt; that both the old and new versions use the same &quot;regularize&quot; function for<br>
&gt; empirical and fixed diagonal.<br>
&gt;<br>
&gt; I was wondering if you could please let me know where am I making a mistake?<br></span></blockquote><div><br></div></span><div>no mistake</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>
&gt; and if I&#39;m not making a mistake then why the regularisation factors are so<br>
&gt; different in the old and new versions?<br>
<br></span></blockquote><div><br></div></span><div>I hope it&#39;s clearer now. These defaults have never been very informed, they are just-so guesses that yield ok results on data we have seen. They are not authoritative by any means. </div><div><br></div><div>Cheers,</div><div>Denis</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>
</span>check with evoked.plot_white the quality of your noise covariances<br>
(old and new ones).<br>
<br>
you can share the plots if you need feedback.<br>
<br>
HTH<br>
Alex<br>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br>
</blockquote></span></div><br></div></div>
<br>_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br></blockquote></div><br></div>