필터 지우기
필터 지우기

How to use the Golden-Section Search for finding the MAX f(x) value?

조회 수: 9 (최근 30일)
Bella
Bella 2016년 5월 31일
댓글: Walter Roberson 2016년 6월 1일
I know how to find the min but not really sure how to find the max..

답변 (2개)

Walter Roberson
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
Bella
Bella 2016년 6월 1일
So are you saying that the max is the positive of the min? I got my min to be -1.6656
Walter Roberson
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
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.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by