I am asking this for my friend -- he could not access Internet currently. So
he asked me but I don't know how to answer.
When using "fminsearch",
options = optimset('fminsearch');
options = optimset(options, 'Display','iter');
[xstar fstar flags]=fminsearch(@(x)ObjectiveFunction(x), x_0, options);
It prints out the following instantly:
-------------------------
x =
0.1000
0.1000
0.1000
0.1000
0.1000
0.1000
0.1000
0.1000
0.1000
0.1000
Iteration Func-count min f(x) Procedure
0 1 1.64236
1 11 1.64236 initial simplex
2 23 1.64236 shrink
3 35 1.64236 shrink
4 47 1.64236 shrink
5 59 1.64236 shrink
6 71 1.64236 shrink
7 83 1.64236 shrink
8 95 1.64236 shrink
9 107 1.64236 shrink
10 119 1.64236 shrink
11 131 1.64236 shrink
12 143 1.64236 shrink
13 155 1.64236 shrink
14 167 1.64236 shrink
15 179 1.64236 shrink
16 191 1.64236 shrink
-------------------------------
And then it continued for about 1 minute with staying at the initial x:
-------------------------------
x =
0.1000
0.1000
0.1000
0.1000
0.1000
0.1000
0.1000
0.1000
0.1000
0.1000
... ...
(all the same)
... ...
x =
0.1000
0.1000
0.1000
0.1000
0.1000
0.1000
0.1000
0.1000
0.1000
0.1000
17 203 1.64236 shrink
Optimization terminated:
the current x satisfies the termination criteria using OPTIONS.TolX of
1.000000e-004
and F(X) satisfies the convergence criteria using OPTIONS.TolFun of
1.000000e-004
-------------------------------------
What's wrong with the program? It didn't search away from the initial values
at all. Since each function evaluation is very costly -- about 1 minute, it
was not possible for the "fminsearch" to finish 203 function evaluations
within a minute and got the final result to be the same as the initial
values. The above print-out information was definitely wrong.
Any thoughts?
Thanks a lot!
I'm guessing there is something wrong with the objective function, and
instead of evaluating properly it just returns a constant value. The
behaviour of Nelder-Mead on a constant function is similar to what
your friend experienced.
"Linus Utopia" <linus_...@gmail.com> wrote in message <f79cgv$k66$1...@news.Stanford.EDU>...
This can happen when the objective function contains quantization operations, which make it piecewise constant. For example,
>> staircase=@(x) interp1(0:10,0:10,x,'nearest'); % global minimum at x=0
>> x=fminsearch(staircase,1.1)
x =
1.1000
>> x=fminsearch(staircase,2.4)
x =
2.4000
>> x=fminsearch(staircase,3.01)
x =
3.0100
"Matt J" wrote in message <imu8d8$t8p$1...@fred.mathworks.com>...
The plot may not reveal much if you've plotted too coarsely. Basically, you want to assess whether there are any operations like ROUND, CEIL, FLOOR, and similar quantization operations used inside your objective function. If so, it means trouble.
You should also make a finely sampled plot around what you think are false solutions to see if, indeed, they are local minima.
"Matt J" wrote in message <in073h$c8v$1...@fred.mathworks.com>...