One Variable Optimization
One Variable Optimization
ONE-VARIABLE OPTIMIZATION
dF d2F
-=O and - > 0 .
dx dx2
dF d 2 ~
~ ' ( x=) - and ~ " ( x=) -
dx dx2 '
Proof The size of the bracket containing the solution is halved on each itera-
tion. Hence, after k iterations the width of the bracket is 2-k(b - a ) . To find
the value of k which gives
The least function value is at xr = 2.25 and hence the search range for the next
iteration is [x,, x;,] = [1.5, 3.01. After re-labelling the points and computing
new values xl ,x, we get
and Fa = -3.375; fi = -3.955; F, = -3.797; F, = -2.584; Fh= 0.
Now the least function value is at xl and the new range is [x,,x,] = [ I S , 2.251.
Re-labelling and adding the new xl and x, we get
xu = 1.5; xl = 1.6875; x, = 1.875; x, = 2.0625; xh = 2.25
and Fa = -3.375; fi = -3.737; F, = -3.955; F, = -3.988; Fh= -3.797.
These values imply the minimum lies in [xl,x,] = [1.875,2.25]. After a few
more steps we have an acceptable approximation to the true solution at x = 2.
The application of the bisection method to a maximum-return problem is illus-
trated below in section 6 of this chapter.
the bisection method. How does the result compare with the bracket obtained
when xo = 1 and a = 0.2?
3 . Use the secant method with strategy (b) on F ( x ) = x3 - 3x2 with xo = 1.5
and xl = 3 . What happens if the starting values are xo = 0.5 and xl = 1.5?
until I F I ( X ~ +I is
~ )sufficiently small.
This algorithm is derived by expanding F ( x ) as a Taylor series about xk
One-variable o p t i m i z a t i o n
If ek is defined by (2.4.4)then there exists an integer K such that, for all k > K,
Proof Since the iterates xk converge to x* there exists an integer K such that
m
xk E N and lekl < - f o r k > K.
2M
Then the bounds (2.4.5) on F1I1imply
5
for some between x* and xk; and since F 1 ( x * )= 0 we deduce
1 2 Ill
F ' ( x ~= +
) - e k ~ I 1 ( x k ) -ekF (6).
2
The next estimate of the minimum is xk+l = xk - 6xk where
However, the minimum of "x 3x2 is at x = 2; and hence the method has
overshot the minimum and given xl further away from the solution than xo.
Suppose now that the Newton iteration is applied to "x 3x2 starting from
xo = 0.9. The new estimate of the minimum turns out to be
and the direction ofthe Newton step is away from the minimum. The iteration
is being attracted to the maximum of F ( x ) at x = 0. (Since the Newton method
solves F 1 ( x )= 0, this is not an unreasonable outcome.)
These two examples show that convergence of the basic Newton iteration de-
pends upon the behaviour of F1'(x) and a practical algorithm should include
safeguards against divergence. We should only use (2.4. I ) if F t l ( x )is strictly
positive; and even then we should also check that the new point produced by
the Newton formula is "better7' than the one it replaces. These ideas are in-
cluded in the following algorithm which applies the Newton method within a
bracket [a,h] such as can be found by the algorithm in section 2.
F ( l . l ) = -2.299, ~ ' ( 1 . 1 =
) -2.97 and ~ " ( 1 . 1 =
) 0.6
the first iteration gives 6x = 4.95. The full step, a = 1 , gives xk + a6x = 6.05
which is outside the range we are considering and so we must re-set
Now F (2.45) = -3.30 1 which is less than F ( 1 . 1 ) . Therefore the inner loop of
the algorithm is complete and the next iteration can begin.
Under certain assumptions, we can show that the inner loop of the safeguarded
Newton algorithm will always terminate and hence that the safeguarded New-
ton method will converge.
Exercises
1 . Use Newton's method to estimate the minimum of ex - 2x in 0 < x 5 1.
Compare the rate of convergence with that of the bisection method.
2. Show that, for any starting guess, the basic Newton algorithm converges in
one step when applied to a quadratic function.
3. Do one iteration of the basic Newton method on the function F ( x ) ="x 3x2
starting from each of the following initial guesses:
Method ;i y~ y2 V R
Bisection 0.7 0.3 0.00169 1.233%
Secant 0.7 0.3 0.00169 1.233%
Newton 0.7 0.3 0.00169 1.233%
We see that all three minimization methods find the same solution but that they
use different numbers of iterations.
When drawing conclusions from a comparison like that in Table 2.1 it is im-
portant to ensure that all the methods have used the same (or similar) initial
guessed solutions and convergence criteria. In the above results, both bisec-
tion and the secant method were given the starting values x = 0 and x = 1.
The Newton method was started from x = 1 (it only needs one initial point).
The bisection iterations terminate when the bracket containing the optimum
has been reduced to a width less than lop4. Convergence of the secant and
Newton methods occurs when the gradient IF1(x)I < lo-'. Therefore it seems
reasonable to conclude that the Newton method is indeed more efficient than
the secant method which in turn is better than bisection.
We now consider another problem to see if similar behaviour occurs. This time
we use data for the first two assets in Table 1.2 and we consider the minimiza-
tion of (1.7.4) with p = 10 and V, = 0.00072. Table 2.2 summarises results
One-variable optimization 31
obtained with sample2 using the same starting guessed values and conver-
gence criteria as for Table 2.1 together with an additional result for Newton's
method when the initial solution estimate is xo = 1.
Method
Table 2.2. Solutions of Maxretlm for first two assets in Table 1.2
The first three rows of Table 2.2 again show the secant and Newton meth-
ods outperforming bisection by finding the same solution in fewer iterations.
In fact the number of bisection steps depends only on the size of the starting
bracket and the convergence criterion while the iteration count for the secant
and Newton methods can vary from one problem to another.
The last row of Table 2.2 shows that a different solution is obtained if Newton's
method is started from xo = 1 instead of xo = 0. This alternative solution is
actually better than the one in the first three rows of the table because the
return R is larger. However, both the solutions are valid local minima of (1.7.4)
and we could say, therefore, that the bisection and secant methods have been
"unlucky" in converging to the inferior one. As mentioned in section 1, most
of the methods covered in this book will terminate when the iterations reach
a local optimum. If there are several minima, it is partly a matter of chance
which one is found, although the one "nearest" to the starting guess is probably
the strongest contender.
Exercises (To be solved using sample2 or other suitable software.)
1. Using the data for the first two assets in Table 1.2, determine the coefficients
of the function (1.7.4). Hence find the maximum return for an acceptable risk
V, = 0.0005 by using the bisection method to minimize (1.7.4). How does your
solution change for different values of p in the range 0.1 5 p 5 lo?
2. Solve the maximum-return problem in question 1 but using the bisection
method to minimize the non-smooth function (1.7.7). Explain why the results
differ from those in question 1.
3. Using data for the first two assets in Table 1.2, form the function (1.7.4) and
minimize it by the secant method when V, = 0.002 and p = 10. Use starting
guesses 0 and 1 for x. Can you explain why a different solution is obtained
when the starting guesses for x are 0.5 and I? (It may help to sketch the func-
tion being minimized.)
4. Minimize (2.6.1) by Newton's method using the initial guess xo = 0.5 and
explain why the solution is different from the ones quoted in Table 2.1. Find
starting ranges for the bisection and secant methods from which they too will
converge to this alternative local minimum.
< <
5. Plot the graph of (2.6.1) for 0.55 x 0.75, when Va = 0.00123 and p = 10
and observe the two local minima. Also plot the graph when V, = 0.001. Can
you explain why there is a unique minimum in this case? What is the smallest
value of Va for which two minima occur?
<
6. Plot the graph of (1.7.8) with p = 1 in the range 0.55 x 5 0.75 first for
Va = 0.001 and then for Va = 0.00123. Does the function have a continuous
first derivative in both cases? Explain your answer.
7. Using any suitable optimization method, minimize (2.6.1) and hence solve
the maximum-return problem for the data in Table 1.3 for values of V, in the
< <
range 0.001 1 V, 0.0033. Plot the resulting values of yl and y2 against Va.
Do these show a linear relationship? How does the graph of maximum-return
R against Va compare with the efficient frontier you would obtain by solving
Minrisklm for the data in Table 1.3?
8. As an alternative to the composite function in Risk-Retl, another function
whose minimum value will give a low value of risk coupled with a high value
for expected return is
For a two-asset problem, use similar ideas to those in section 1.3 of chapter
1 and express F as a function of invested fraction yl only. Use the bisection
method to minimize this one-variable form of (2.6.2) for the data in Table 1.3.
Also obtain an expression for dF/dyl and use the secant method to estimate
the minimum of F for the same set of data.
http://www.springer.com/978-1-4020-8110-1