<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.msochpdefault, li.msochpdefault, div.msochpdefault
        {mso-style-name:msochpdefault;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri","sans-serif";}
span.e-mailformatvorlage17
        {mso-style-name:e-mailformatvorlage17;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.E-MailFormatvorlage20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Dear Sophie,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">thanks a lot for your quick answer.
</span><span lang="EN-US" style="color:#1F497D">The configuration I used is the following:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg = [] ;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.method          =
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'mvpa'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.mvpa.classifier =
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'logreg'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">;
</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.mvpa.metric     =
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'accuracy'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.mvpa.k          = 3;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.mvpa.param.reg =
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'l2'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.mvpa.param.lambda =
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'auto'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.mvpa.param.plot = 1;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.latency         = [0.5, 0.7];</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.avgovertime     =
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'yes'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.design          = [ones(nFIC,1); 2*ones(nFC,1);];</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black"></span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">stat = ft_timelockstatistics(cfg, dataFIC_LP, dataFC_LP)</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="color:#1F497D">It seems to be important to write cfg.mvpa.param instead of cfg.param, otherwise it just ignores the L2 regularization and runs  ‘logf’ instead.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="color:#1F497D">I hope you can replicate the error this way.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="color:#1F497D">Thanks in advance, best,<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="color:#1F497D">Kirsten</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Von:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Arana, S.L. (Sophie) [mailto:S.Arana@donders.ru.nl]
<br>
<b>Gesendet:</b> Donnerstag, 9. Mai 2019 11:18<br>
<b>An:</b> fieldtrip@science.ru.nl<br>
<b>Cc:</b> Herfurth, Kirsten<br>
<b>Betreff:</b> Re: Error occurs when applying searchgrid for lambda in MVPA light toolbox<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><span style="font-family:"Calibri","sans-serif";color:black">Dear Kirsten,<o:p></o:p></span></p>
<p><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<p><span style="font-family:"Calibri","sans-serif";color:black">I could not replicate your error with the MVPAlight toolbox. Could you post the code you used on the tutorial data that gave you the error?<o:p></o:p></span></p>
<p><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<p><span style="font-family:"Calibri","sans-serif";color:black">Best,<o:p></o:p></span></p>
<p><span style="font-family:"Calibri","sans-serif";color:black">Sophie​<o:p></o:p></span></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:12.0pt;color:#212121">
<hr size="2" width="98%" align="center">
</span></div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> fieldtrip <fieldtrip-bounces@science.ru.nl> on behalf of Herfurth, Kirsten <Kirsten.Herfurth@uk-erlangen.de><br>
<b>Sent:</b> Tuesday, May 7, 2019 1:08 PM<br>
<b>To:</b> fieldtrip@science.ru.nl<br>
<b>Subject:</b> [FieldTrip] Error occurs when applying searchgrid for lambda in MVPA light toolbox</span><span style="font-size:12.0pt;color:#212121">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:#212121"> <o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="color:#212121">Dear fieldtrip developers,</span><span style="color:#212121"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#212121"> </span><span style="color:#212121"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="color:#212121">I’m extremely enthusiastic about the newly implemented MVPA light toolbox on fieldtrip, thanks a lot! I’m trying out logistic regression on my data and would like to do
 a search grid for lambda with cfg.mvpa.param.lambda = ‘auto’. However, I get the following error message in line 433 of train_logreg.m when calculating the gradient g = ((cfg.weights .* sigma)' * YX)'/N - sumyxN + lambda * w: matrix dimensions must agree.</span><span style="color:#212121"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="color:#212121">If I just pass one value for lambda, it works fine.
</span><span style="color:#212121"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="color:#212121">The same error occurs with the tutorial data. Here, cfg.weights has a 100x1 dimension, and sigma is 80x1 in size. I’m using Matlab 2017b and the most recent fieldtrip
 2019-04-19 version.</span><span style="color:#212121"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black"> </span><span style="color:#212121"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="color:#212121">I don’t know where to fix this and would be very grateful for your help.</span><span style="color:#212121"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="color:#212121"> </span><span style="color:#212121"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:#212121">Best wishes,<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:#212121"> <o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:#212121">Kirsten Herfurth<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#212121"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#212121">Post-Doc at the MEG-lab in Erlangen, Germany</span><span style="color:#212121"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#212121"> </span><span style="color:#212121"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#212121"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#212121"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#212121"> <o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</body>
</html>