Calculus

Lesson 14 of 14

Numerical Methods: Newton, Bisection and Finite Differences

Root finding by bisection and Newton's method, solving for implied volatility, and finite-difference Greeks with the right step size.

Bisection: trap the root and halve

A lot of quant questions come down to an equation you cannot solve with algebra. The yield of a bond, the internal rate of return of a set of cash flows and the implied volatility of an option all have the same shape: find xx with f(x)=0f(x) = 0, where ff is easy to evaluate but has no inverse you can write down.

Bisection needs only continuity and a bracket. If f(a)f(a) and f(b)f(b) have opposite signs, the intermediate value theorem puts a root in [a,b][a, b]. Evaluate the midpoint, keep the half where the sign still changes, and repeat. Each step halves the bracket, so after nn steps the error is at most (b−a)/2n(b - a)/2^n.

Example: pay $100 today and receive $60 at the end of each of the next two years. The IRR solves

f(r)=−100+601+r+60(1+r)2=0.f(r) = -100 + \frac{60}{1+r} + \frac{60}{(1+r)^2} = 0.

Since f(0)=20f(0) = 20 and f(0.5)=−33.3f(0.5) = -33.3, a root lies in [0,0.5][0, 0.5]. The first midpoint 0.250.25 gives f=−13.6f = -13.6, so the root is in [0,0.25][0, 0.25]. Next 0.1250.125 gives f=+0.74f = +0.74, so it is in [0.125,0.25][0.125, 0.25]. Four more steps leave the bracket [12.5%,13.28%][12.5\%, 13.28\%]. The exact answer is 13.066%13.066\%.

Bisection is slow. Every step buys one binary digit, so shrinking a bracket of width 0.50.5 to 10−610^{-6} takes ⌈log⁡2(0.5/10−6)⌉=19\lceil \log_2(0.5/10^{-6}) \rceil = 19 steps. In return it is guaranteed to converge, and it never needs the derivative.