
146 Numerical Methods and Optimization: An Introduction
t
y(t
1
)
y
1
y
0
t
0
t
1
y = y(t)
y
FIGURE 7.1: An illustration of the one-step Euler method.
Example 7.6 Suppose that we have a 30-year 10% coupon bond with yield to
maturity λ
0
= 10% and price P
0
= 100. We are interested to know the price of
this bond when its yield changes to λ
1
= 11%. We can use the price sensitivity
formula mentioned in Example 7.1:
dP
dλ
= −PD
M
, with P (λ
0
)=P
0
.
Let us use Euler’s method to solve the above equation. We have
f(λ, P )=−PD
M
; λ
0
= 10; P
0
= 100; h =0.11 − 0.10 = 0.01;
f(λ
0
,P
0
)=−P
0
D
M
(0.10, 2, 30, 0.10) = −100 · 9.47 = −947.
Therefore,
P (λ
1
) ≈ 100 + 0.01(−947) = 100 − 9.47 = 90.53.
Example ...