Functions with same evaluation outputs and same starting point have different fminsearch outcomes?
이전 댓글 표시
Hi guys,
I have two numerical functions f1 and f2 and for some reason, I cannot show the detailed codes for them. Basically, f2 is the vectorized version of f1.
These two functions have the same values for any inputs. Given the same starting point, however, the fminsearch gives different minimizer and different minimized function value.
What could be the reason behind it?
Thanks,
Jialin
채택된 답변
추가 답변 (1개)
Walter Roberson
2017년 7월 18일
0 개 추천
fminsearch uses a random number generator so it will not produce the same results unless the random seed is rese
댓글 수: 1
Mukul Rao
2017년 7월 19일
편집: Alan Weiss
2017년 7월 19일
Hi Walter, thanks for pitching in. While random number generators are used by many of our solvers, especially global optimization solvers, it is not the case with fminsearch. It's based on the Nelder Mead algorithm, MATLAB's implementation of this algorithm is deterministic. I have verified this looking at the source code for "fminsearch" and also getting in touch with my colleagues in development. You can also try running the fminsearch algorithm on the same problem with the same initial conditions several times, it always returns the same solution (I've tried this on R2017a).
카테고리
도움말 센터 및 File Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!