Sie sind auf Seite 1von 15

A U T U M N    2 0 0 9

NEWTON–RAPHSON METHODS

Numerical Methods in Finance (Implementing Market Models)


COMPUTATIONAL FINANCE
MSc
©Finbarr Murphy 2007

Lecture Objectives
 The Newton Raphson Method
COMPUTATIONAL FINANCE
MSc
©Finbarr Murphy 2007

Agenda
Page

1
Newton Raphson 2

3
COMPUTATIONAL FINANCE
MSc

3
©Finbarr Murphy 2007

Newton Raphson

 This brief lecture is a tangent to the core module


emphasis but is necessary
 Or at least useful

 the Newton–Raphson method is an efficient algorithm


for finding approximations to the zeros (or roots) of a
real-valued function
 As such, it is an example of a root-finding algorithm.

4
©Finbarr Murphy 2007

Newton Raphson

 Given a simple polynomial equation:

y = x3 + x 2 − 7 x − 2
 What are the roots?
 One method is to guess…

5
©Finbarr Murphy 2007

Newton Raphson

 This is obviously inefficient and we also need to


make a good guess
 If we need f(r) = 0, we start with a guess x1
 The blue line is the slope at x1

6
©Finbarr Murphy 2007

Newton Raphson

 The slope in general is


dy
= 3x 2 + 2 x − 7
dx
 The slope line intercepts the x-axis at x2, nearer x1

f ( x1 )
x2 = x1 −
f ' ( x1 )

7
©Finbarr Murphy 2007

Newton Raphson

 Our guesses become much better

 But we might have to search a couple of places to get


the roots 8
©Finbarr Murphy 2007

Newton Raphson

 There are three roots to this system (-3.06871,


-0.27775, 2.3464)
120

100

80

60

40

20

-20

-40

-60

9
-80
-5 -4 -3 -2 -1 0 1 2 3 4 5
©Finbarr Murphy 2007

Newton Raphson

 A Matlab related function is interp1

10
©Finbarr Murphy 2007

Newton Raphson

 It would be great if we dealt with polynomials,


unfortunately, we don’t!

 Consider the Black-Scholes formula:


c = SN ( d1 ) − Ke − rT N ( d 2 )

d1 =
( )
ln ( S 0 / K ) + r + σ 2 / 2 T
;
σ T
ln ( S 0 / K ) + ( r − σ 2 / 2 )T
d2 = = d1 − σ T
σ T
 If we know c, what is the implied volatility?

11
©Finbarr Murphy 2007

Newton Raphson

 We know
∂σ
ν= = S 0 T N ′( d1 )
∂S

 So we can use Newton-Raphson here

 But if we don’t have a closed form derivative?

 We can use techniques’s such as Brent’s method (see


Wiki or other resources)

12
©Finbarr Murphy 2007

Newton Raphson

 We just concern ourselves here with implementation


 In Matlab, x = fzero(fun,x0) tries to find a zero of fun
near x0, if x0 is a scalar
 fun is a function handle.

 E.g.
 f = @(x)x.^3+x.^2-7*x-2;
 z = fzero(f,2) = 2.3465
 z = fzero(f,0) = -0.2778

13
©Finbarr Murphy 2007

Newton Raphson

 This is an insight into some of these optimisation


problems.

 We will look at some examples later in the module


when we are trying to fit interest rate curves

14
©Finbarr Murphy 2007

Recommended Texts
 Required/Recommended
 MatLab Help files
 Wikipedia (see Brent/Dekker)

 Additional/Useful
COMPUTATIONAL FINANCE
MSc

15

Das könnte Ihnen auch gefallen