How to change the tolerance of optimization function lsqnonlin()?

6 次查看(过去 30 天)
I tried changing the tolerance like this....
options = optimset('TolFun',1e-8);
[N,resnorm] = lsqnonlin(@myfunction5,n,[],[],options);
definition of myfunction5....
function r5 = myfunction5(N) global f1 f1 = 999000; r = zeros(10000,1); f = zeros(10000,1); for p = 1:10000 r(p,1) = 5 * sin(2*3.14*f1*(p/(10000000))+0.3); end for q1 = 1:10000 f(q1,1) = N(1) * sin((2*3.14*N(2)*(q1/10000000)) + N(3)); end r5 = r-f; end
But it is displaying this message and the value of N hence achieved is far from my requirement...
Local minimum possible.
lsqnonlin stopped because the final change in the sum of squares relative to its initial value is less than the selected value of the function tolerance.
How to set this up?
  1 个评论
Sushant  Kumar
Sushant Kumar 2013-5-28
Also, i checked whether tolerance has changed or not using...
optimset('lsqnonlin')
but it displayed the default value of 'TolFun' only. Should i also change 'TolX'?

请先登录,再进行评论。

回答(1 个)

Alan Weiss
Alan Weiss 2013-5-28
The exit message tells you that lsqnonlin used your TolFun:
lsqnonlin stopped because the final change in the sum of squares relative to its initial value is less than
the selected value
of the function tolerance.
For documentation on improving your results (which might be fine, the exit message only means that the first-order optimality is not all that small), see Local Minimum Possible.
Alan Weiss
MATLAB mathematical toolbox documentation

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by