Unimodal Functions and Golden Section Search

6.4.2 Unimodal Functions and Golden Section Search

A condition which ensures that a function g has a unique global minimum τ in [a, b] is that g(x) is strictly decreasing for a ≤ x < τ and strictly increasing for τ < x ≤ b. Such a

function is called unimodal.

Definition 6.4.1.

The function g(x) is unimodal on [a, b] if there exists a unique τ ∈ [a, b] such that, given any c, d ∈ [a, b] for which c < d

d<τ ⇒ g(c) > g(d), c>τ ⇒ g(c) < g(d). (6.4.2) This condition does not assume that g is differentiable or even continuous on [a, b].

For example, |x| is unimodal on [−1, 1]. We now describe an interval reduction method for finding the local minimum of

a unimodal function, which only uses function values of g. It is based on the following lemma.

Lemma 6.4.2.

Suppose that g is unimodal on [a, b], and τ is the point in Definition 6.4.1. Let c and

d be points such that a ≤ c < d ≤ b. If g(c) ≤ g(d), then τ ≤ d, and if g(c) ≥ g(d), then τ ≥ c.

Proof. If d < τ , then g(c) > g(d). Thus, if g(c) ≤ g(d), then τ ≤ d. The other part follows similarly.

Assume that g is unimodal in [a, b]. Then using Lemma 6.4.2 it is possible to find a reduced interval on which g is unimodal by evaluating g(x) at two interior points c and d

such that c < d. Setting

[a ′ ,b ′

[c, b] if g(c) > g(d),

[a, d] if g(c) < g(d),

we can enclose x ∗ in an interval of length at most equal to max(b−c, d−a). (If g(c) = g(d), then τ ∈ [c, d], but we ignore this possibility.) To minimize this length one should take c

658 Chapter 6. Solving Scalar Nonlinear Equations and d so that b − c = d − a. Hence c + d = a + b, and we can write

0 < t < 1/2. Then d − a = b − c = (1 − t)(b − a), and by choosing t ≈ 1/2 we can almost reduce the

c = a + t (b − a),

d = b − t (b − a),

length of the interval by a factor 1/2. But d − c = (1 − 2t)(b − a) must not be too small for the available precision in evaluating g(x).

If we only consider one step the above choice would be optimal. Note that this step requires two function evaluations. A clever way to save function evaluations is to arrange it so that if [c, b] is the new interval, then d can be used as one of the points in the next step; similarly, if [a, d] is the new interval, then c can be used at the next step. Suppose this can be achieved with a fixed value of t. Since c + d = a + b the points lie symmetric

with respect to the midpoint 1 2 (a + b) and we need only consider the first case. Then t must satisfy the following relation (cf. above and Figure 6.4.1):

d − c = (1 − 2t)(b − a) = (1 − t)t (b − a).

Hence t should equal the root in the interval (0, 1/2) of the quadratic equation 1−3t+t 2 √

= 0, which is t = (3 − 5)/2. With this choice the length of the interval will be reduced by the factor

1 − t = 2/(

at each step, which is the golden section ratio. For example, 20 steps gives a reduction of

the interval with a factor (0.618034 . . .) 20 ≈ 0.661 · 10 −5 .

Figure 6.4.1. One step of interval reduction, g(c k ) ≥ g(d k ).

Algorithm 6.2. Golden Section Search. The function goldsec computes an approximation m ∈ I to a local minimum of a given

function in an interval I = [a, b], with an error less than a specified tolerance τ.

6.4. Finding a Minimum of a Function 659 function xmin = goldsec(fname,a,b,delta);

% t = 2/(3 + sqrt(5));

c = a + t*(b - a); d = b - t*(b - a);

fc = feval(fname,c); fd = feval(fname,d);

while (d - c) > delta*max(abs(c),abs(d)) if fc >= fd

% Keep right endpoint b

a = c; c = d;

fc = fd; d = b - t*(b - a); fd = feval(fname, d); else

% Keep left endpoint a

b = d; d = c;

fd = fc; c = a + t*(b - a); fc = feval(fname, c); end; end; xmin = (c + d)/2;

Rounding errors will interfere when determining the minimum of a scalar function g(x) . Because of rounding errors the computed approximation f l(g(x)) of a unimodal function g(x) is not in general unimodal. Therefore, we assume that in Definition 6.4.1 the points c and d satisfy |c − d| > tol, where

tol = ǫ|x| + τ

is chosen as a combination of absolute and relative tolerance. Then the condition (6.4.2) will hold also for the computed function. For any method using only computed values of g there is a fundamental limitation in the accuracy of the computed location of the minimum point τ in [a, b]. The best we can hope for is to find x k ∈ [a, b] such that

g(x k ) ≤ g(x ∗ ) + δ,

where δ is an upper bound of rounding and other errors in the computed function values ¯g(x) = f l (g(x)). If g is twice differentiable in a neighborhood of a minimum point τ ,

then by Taylor’s theorem

This means that there is no difference in the floating-point representation of g(τ + h) unless

h is of the order of √u. Hence we can not expect τ to be determined with an error less than

(6.4.3) unless we can also use values of g ′ or the function has some special form.

2 δ/|g ′′ (x ∗ ) |,

660 Chapter 6. Solving Scalar Nonlinear Equations

Dokumen yang terkait

Analisis Komparasi Internet Financial Local Government Reporting Pada Website Resmi Kabupaten dan Kota di Jawa Timur The Comparison Analysis of Internet Financial Local Government Reporting on Official Website of Regency and City in East Java

19 819 7

ANTARA IDEALISME DAN KENYATAAN: KEBIJAKAN PENDIDIKAN TIONGHOA PERANAKAN DI SURABAYA PADA MASA PENDUDUKAN JEPANG TAHUN 1942-1945 Between Idealism and Reality: Education Policy of Chinese in Surabaya in the Japanese Era at 1942-1945)

1 29 9

Improving the Eighth Year Students' Tense Achievement and Active Participation by Giving Positive Reinforcement at SMPN 1 Silo in the 2013/2014 Academic Year

7 202 3

An Analysis of illocutionary acts in Sherlock Holmes movie

27 148 96

The Effectiveness of Computer-Assisted Language Learning in Teaching Past Tense to the Tenth Grade Students of SMAN 5 Tangerang Selatan

4 116 138

The correlation between listening skill and pronunciation accuracy : a case study in the firt year of smk vocation higt school pupita bangsa ciputat school year 2005-2006

9 128 37

Existentialism of Jack in David Fincher’s Fight Club Film

5 71 55

Phase response analysis during in vivo l 001

2 30 2

The Risk and Trust Factors in Relation to the Consumer Buying Decision Process Model

0 0 15

PENERAPAN ADING (AUTOMATIC FEEDING) PINTAR DALAM BUDIDAYA IKAN PADA KELOMPOK PETANI IKAN SEKITAR SUNGAI IRIGASI DI KELURAHAN KOMET RAYA, BANJARBARU Implementation of Ading (Automatic Feeding) Pintar in Fish Farming on Group of Farmer Close to River Irriga

0 0 5