lambda in fmincon returns multiple values
10 次查看(过去 30 天)
显示 更早的评论
Hello,
I am using 'fmincon' for an optimization problem. I am interested in lambda.lower as I have a lower bound constraint. However, in the 'lambda' structure, which is obtained as one of the outputs, I can see multiple values of lambda.lower, all of which are positive. I have used 'lasso' and 'lassoglm' which have a 'LambdaMinSSE' parameter,(lambda value for the minimum error) but I do not see any such information in fmincon. Could someone please tell me how to select the lambda in fmincon?
Thanks so much!
0 个评论
回答(1 个)
Matt J
2014-12-10
编辑:Matt J
2014-12-10
So, for example, when I run as follows I get a vector of values for lambda.lower
>> [x,fval,exitflag,output,lambda] = fmincon(@(x)norm(x)^2,[10,10],[],[],[],[],[1;1]);
>> lambda.lower
ans =
2
2
Is this what you're talking about? If so, it's normal. My problem is two dimensional, and so the lower bound input argument lb specifies 2 bounds, both of which need associated Lagrange multipliers.
2 个评论
Matt J
2014-12-10
编辑:Matt J
2014-12-10
I don't understand what "this lambda in the objective function" is and how it got there. The only way a variable can be in the workspace of the objective function is if you put it there, so I don't see what the problem is recovering it. It is also making the conversation confusing using the label "lambda" both for a variable inside your objective function and the lambda output by fmincon. You should change notation to make things clearer.
As a side note, your objective function is not differentiable because of the norm(x,1) term, and therefore not legal for use with fmincon. You should replace that term by sum(x), which is equivalent to norm(x,1) when x>=0, but is differentiable.
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!