Unable to set optimset

1 view (last 30 days)
Robbie
Robbie on 18 Jun 2014
Edited: Matt J on 18 Jun 2014
Hello,
I am using R2011b (7.13.0.564), 32-bit (glnx86) on Ubuntu 12.04LTS (since I installed my Ubuntu at 32 bit).
I try to set the options through optimset as follows:
x0 = 3e-7;
options = optimset('Display','iter','TolX',1e-5);
options.TolX = 1.000000e-07;
[x, resnorm] = lsqnonlin(@test18062014,x0);
x, resnorm
Here the function test18062014 yields a vector of size 4 with a minimum sum of squares around 2.67e-7. Thee output is as follows:
Local minimum possible.
lsqnonlin stopped because the size of the current step is less than
the default value of the step size tolerance.
<stopping criteria details>
x =
3.0904e-07
resnorm =
8.4427
Optimization stopped because the norm of the current step, 3.094088e-09,
is less than options.TolX = 1.000000e-06.
Optimization Metric Options
norm(step) = 3.09e-09 TolX = 1e-06 (default)
>>
There are two things I don't understand.
1. Why is TolX not changed? I even changed it twice, just to make sure.
2. How come I end up at 3.09e-7, which is further away (but rather close to) the minimum at 2.67e-7?
I am mainly worried about the first one (including why I don't get to see any iterations, despite asking for it).
Thank you in advance!

Accepted Answer

Matt J
Matt J on 18 Jun 2014
Edited: Matt J on 18 Jun 2014
  1. You set the options correctly. You just never passed the options struct to lsqnonlin.
  2. The toolbox algorithms don't always walk a straight line path between x0 and the solution. For one thing, the straight line path may point uphill, initially. Most algorithms seek downhill paths. Whatever path the algorithm does choose, it will stop at the first point satisfying stopping criteria.

More Answers (0)

Categories

Find more on Optimization in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!