How to use the Golden-Section Search for finding the MAX f(x) value?
18 ビュー (過去 30 日間)
古いコメントを表示
I know how to find the min but not really sure how to find the max..
0 件のコメント
回答 (2 件)
Walter Roberson
2016 年 6 月 1 日
gs_max = @(x) -gs_min(-x)
That is, if you know how to find the min then you can find the max by finding the minimum of the negative of the values.
2 件のコメント
Walter Roberson
2016 年 6 月 1 日
Example:
A = [15 -3 8 17 5]
min(A) = -3
-min(-A) = -min([-15 +3 -8 -17 -5]) = -(-17) = 17
max(A) = 17
So whatever process you have for finding minimum, feed in the negative of the data, find the minimum of that, and take the negative of the result, and you will have the maximum of the original data.
Roger Stafford
2016 年 6 月 1 日
Finding the maximum would work the same way as with the minimum except that 1) you need to work in an interval for which your function is unimodal with a maximum, and 2) with reference to the site
https://en.wikipedia.org/wiki/Golden_section_search
the reversals that are mentioned in the “Algorithm” section are applied.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!