different minimum result of convex function by using fminsearch
조회 수: 1 (최근 30일)
이전 댓글 표시
A function which I used is already proved as a convex function.
1. initial point = [0,0,0,0,0,0]
myfun = @(x)(......)
[x, fval] = fminsearch(myfun, [0,0,0,0,0,0])
2. initial point = [0.2,0.2,0.2,0.2,0.2,0.2]
myfun = @(x)(......)
[x, fval] = fminsearch(myfun, [0.2,0.2,0.2,0.2,0.2,0.2])
- _ | | The "fval" results are quite different.||_*
I expect that if "myfun" is a convex function, the result should be similar. Although the fminsearch find out the local minimum, since the myfun is convex, so the result should be one whatever the initial point is.
What I guess:
# Lack of Number of iteration?
Help me!
댓글 수: 5
채택된 답변
John D'Errico
2017년 2월 20일
편집: John D'Errico
2017년 2월 20일
fminsearch is a very simple optimizer, so I am not at all surprised to see this happen.
1. A 6 dimensional problem is near the upper limit of where I would recommend using fminsearch.
2. ANY optimizer will converge to slightly different solutions, stopping when it decides it is close enough. Close enough is determined by when the objective function is not changing by a significant amount. If the solver hits the iteration or function evaluation limit, then it will also stop looking.
3. If your objective function is flat enough, then an optimizer can also easily terminate far away from the true minimum.
Solution? Start by using a better optimizer. Even then, don't be surprised to see if some other numerical optimizer does exactly the same thing.
댓글 수: 2
Walter Roberson
2017년 2월 20일
A function with a slope of (for example) 1E-15 might have all of the probe values within the current tolerance, with it not being detectable that the slope is real and important to chase for long ways.
You can construct functions of the form
-1/(delta + (x-c)^p)
for large even integer p and positive delta. These functions have a sharp valley close to x == c, but the delta and the fact that (x-c)^even is non-negative prevents the function from being a singularity; instead it has a minimum at -1/delta and the "effective" catch basin of the minimum can be made arbitrarily tight by increasing p. Calculus has no problem dealing with the situation, but numeric algorithms have finite tolerance and give up.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Direct Search에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!