Error using lsqncommon (line 67)
이전 댓글 표시
Hi,
I have a case with an optim via lsqnonlin just trying to minimize a price but the lsqncommon is handing over my optim.
[x,resnorm,FVAL,Exitfalg,output] = lsqnonlin(G, I, lb, ub, options);
with G an function handled returning a price difference between two set.
I = [0.1 0.1 0.1 0.1 -1];
the returned error is as follow Error using lsqncommon (line 67) The Levenberg-Marquardt algorithm does not handle bound constraints and the trust-region-reflective algorithm requires at least as many equations as variables; aborting
lb = [0 0 0 0 -1];
ub = [1 1 1 1 1];
Would you provide a support?
thanks.
댓글 수: 6
Star Strider
2015년 9월 4일
What is the code for your ‘G’ function? From the error text, it may be the problem.
DIMITRY
2015년 9월 4일
DIMITRY
2015년 9월 4일
Star Strider
2015년 9월 4일
No idea, because I still haven’t seen the code for ‘G’!
DIMITRY
2015년 9월 4일
Star Strider
2015년 9월 4일
I really need to see the full code for ‘G’.
What parameter are you optimising with respect to?
답변 (1개)
You have 5 unknowns and therefore the trust region algorithm expects your G function to return at least 5 elements (representing 5 equations), so that the system is over-determined. Instead, though, your G() is returning a scalar.
It doesn't really make sense to be solving 1 equation in 5 unknowns, so you should probably get more equations from somewhere. Possibly, you've misinterpreted lsqnonlin and think that, like fmincon/fminunc,etc... lsqnonlin expects a scalarized objective function. It does not.
카테고리
도움말 센터 및 File Exchange에서 Choose a Solver에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!