optimization technique problem with different outputs
古いコメントを表示
i am doing one optimization technique as there is a randomness in the technique i getting new value as a output every time some times repeated value if i run for 20 times i getting 20values some may be same now which value i need to choose correct value. is there any tool in matlab or any code to justify my problem?
5 件のコメント
Ameer Hamza
2020 年 3 月 7 日
編集済み: Ameer Hamza
2020 年 3 月 7 日
Which optimization function are you using? Have you written the function yourself? If you are using MATLAB's optimization toolbox functions, then probably every solution is a local minimum. In that case, you might try using global optimization toolbox: https://www.mathworks.com/help/gads/index.html?s_tid=CRUX_lftnav
rajesh kumar
2020 年 3 月 7 日
Walter Roberson
2020 年 3 月 7 日
Yes, the one and ONLY concept is that you select the configuration that gave you the best function value, even if it is only better only by 1E-278.
Note that unless you are using the symbolic toolbox, what you are optimizing at any time is not a formula, but rather an implementation of a formula. In floating point, A+B+C is not necessarily the same as C+A+B. So you choose the configuration or technique that gives you the best output for that implementation no matter how small the difference is.
This assumes that the configuration does not violate any constraints, even by a hair. If you permit a constraint violation at all, even just to take into account round-off error, then you need quite different reasoning about which solution to choose.
Ameer Hamza
2020 年 3 月 7 日
Walter's answer explains the computational aspect of this issue. However, this might be the case that the system is underdetermined, and there are potentially infinite solutions to your optimization problem, each giving exactly the same optimal value. If this is the case, then you can consider adding some more constraint considering the underlying problem you are trying to solve. Anyway, the justification of a solution will depend on the problem you are trying to solve. If you just want to get a unique solution every time you run the code, you can just add
rng(0)
at the beginning of your code to seed the random number generator with the same value. You will get the same solution every time.
Walter Roberson
2020 年 3 月 7 日
If you do find multiple solutions that are bit-for-bit identical in optimal function value, then in some cases you just pick one arbitrarily for illustration purposes; and in other cases you need to find the entire set of solutions or a formula to generate the entire set. In other cases for illustration you want to find the first few solutions for plotting purposes, where "first" typically refers to those with smallest positive independent variable to make it easier to plot. But if you are faced with something like sinc wave with infinite oscillations near 0 then your only "justification" for picking some has to do with giving nice separation in a low resolution diagram.
回答 (1 件)
Walter Roberson
2020 年 3 月 7 日
0 投票
About the only test that can justify one optimization result compared to another, is to compare the value of the objective function, and choose the configuration that leads to the minimum or maximum as appropriate.
2 件のコメント
rajesh kumar
2020 年 3 月 7 日
Walter Roberson
2020 年 3 月 7 日
By the way, if the question is which optimization technique is the best, then you need to define carefully what "best" means. If you have an optimization technique that produces a solution to (say) 45 bits accuracy in (say) 3 seconds, and you have a different technique that produces a solution to 48 bits accuracy (roughly one more decimal place) in (say) 3 hours, then which is best? How much extra time are you prepared to spend for each extra bit of accuracy?
カテゴリ
ヘルプ センター および File Exchange で Surrogate Optimization についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!