Web & Social Media Analytics Previous Year Question Paper.pdf
Duration and Convexity
1. Quantitative Finance
QF with MatLab
Mario Dell’Era
Scuola Superiore Sant’Anna
March 30, 2012
Mario Dell’Era Quantitative Finance
2. Interest rate sensitivity and bond portfolio
Immunization
Given a stream of cash flows occurring at times t0, · · · , tn the
duration of the stream is defined as
D =
PV(t0)t0 + · · · + PV(tn)tn
PV
where PV is the present value of the whole stream and PV(ti ) is the
present value of cash flow ci occurring at time ti , i = 0, 1, · · · , n.
PV =
n
k=1
ck
(1 + λ/m)k
Mario Dell’Era Quantitative Finance
3. When we consider a generic bond and use the yield as the discount
rate in computing the present values, we get Macaulay duration:
D =
n
k=1
k
m
ck
(1+λ/m)k
n
k=1
ck
(1+λ/m)k
where it is assumed that there are m coupon payments per year.
Mario Dell’Era Quantitative Finance
4. In order to see why duration is useful, let us compute the derivative of
the price with respect to yield:
dP
dλ
=
d
dλ
n
k=1
ck
(1 + λ/m)k
=
n
k=1
d
dλ
ck
(1 + /m)k
= −
n
k=1
k
m
ck
(1 + λ/m)k+1
If we define the modified duration DM = D/(1 + λ/m), we get:
dP
dλ
= −DM P(λ).
Mario Dell’Era Quantitative Finance
5. Thus we see that the modified duration is related to the slope of the
price-yield curve at a given point. This suggest the opportunity of
using a first order approximation:
δP −DM P(λ)δλ
Am even better approximation may be obtained by using a
second-order approximation. This may be done by defining the
convexity:
C =
1
P
d2
P
dλ2
.
Mario Dell’Era Quantitative Finance
6. It turns out that, for a bond with m coupons per year:
C =
1
P(1 + λ/m)2
n
k=1
k(k + 1)
m2
ck
(1 + λ/m)k
Note that the unit of measure of convexity is time squared. Convexity
is actually a desirable property of a bond, since a large convexity
implies a slower decrease in value when the required yield increases,
and a faster increase in value if the required yield decreases.
Mario Dell’Era Quantitative Finance
7. Using both convexity and duration, we have the second order
approximation:
δP(λ) −DM P(λ)(δλ) +
P(λ)C
2
(δλ)2
This relation is known in literature as immunization of bond portfolio.
Mario Dell’Era Quantitative Finance
8. Example
We may check the quality of the price change approximation based
on duration and convexity with a simple example. Let us consider a
stream of four cash flows (10, 10, 10, 10) occurring at times
t = 1, 2, 3, 4. We may compute the present values of this stream
under different yield values using MATLAB function pvvar.
Mario Dell’Era Quantitative Finance
9. >> cf= [10 10 10 10]
cf=
10 10 10 10
>> p1=pvvar([0, cf], 0.05 )
p1=
35.4595
>> p2=pvvar([0, cf], 0.055 )
p2=
35.0515
>>p2-p1
ans=
-0.4080
we see that increasing the yield by 0.005 results in a price drop of
0.4080.
Mario Dell’Era Quantitative Finance
10. Now we may compute the modified duration and the convexity using
the function cfdur and cfconv. The function cfdur returns both
Macauley and modified duration; for our purposes, we must pick up
the second output value:
>> [d1 dm]=cfdur(cf, 0.05)
d1=
2.4391
dm=
2.3229
>> cv= cfconv(cf, 0.05)
cv=
8.7397
>> −dm ∗ p1 ∗ 0.005
ans=
-0.4118
>> −dm ∗ p1 ∗ 0.005 + 0.5 ∗ cv ∗ p1 ∗ (0.005)2
and=
-0.4080
Mario Dell’Era Quantitative Finance
11. We see that at least for a small change in the yield, the first-order
approximation is satisfactory and the second-order approximation is
practically exact.This process is called immunization.
Mario Dell’Era Quantitative Finance
12. Example
A common problem in bond portfolio management is to shape a
portfolio with a given (modified) duration D and convexity C. Suppose
we have a set of tree bonds; we would like to find a set of portfolio
weights w1, w2 and w3, one for each bond, such that:
3
i=1
wi Di = D
3
i=1
wi Ci = C
3
i=1
wi = 1
where Ci and Di are the convexities and durations respectively
(i = 1, 2, 3).
Mario Dell’Era Quantitative Finance
13. % SET BOND FEATURES (bondimmum.m)
settle= ’28-Aug-2007’;
maturities=[’15-Jun-2012’ ; ’31-Oct-2017’ ; ’01-Mar-2027’];
couponRates=[0.07; 0.06 ; 0.08];
yields=[0.06 ; 0.07 ; 0.075];
Mario Dell’Era Quantitative Finance
14. % COMPUTE DURATIONS AND CONVEXITIES
durations=bnddury(yields, couponRates, settle, maturities);
convexities=bndconvy(yields, couponRate, settle, maturities);
Mario Dell’Era Quantitative Finance
15. % COMPUTE PORTFOLIO WEIGHTS
A=[duration’ convexities’ 1 1 1];
b=[10 160 1];
wieghts=A / b
Mario Dell’Era Quantitative Finance
17. Interest-Rate Derivatives
Interest-rate Swaps
A swap is an arrangement between two parties, which agree to
exchange cash flows at predetermined dates in the future. In the
vanilla swap, one party will pay cash flows given by a fixed interest
rate applied to a nominal amount of money (the notional
principle).The other party will pay am amount given by a variable
interest rate, applied to a given interval of time (the tenure), on the
same notional principal. The net cash flow will depend on the level of
the future interest rates.
Mario Dell’Era Quantitative Finance
18. Bond Options
A call on a bond works more or less like a call option on a stock, with
a different underlying asset. In this case we have two maturities: the
maturity T of the option, at which the option can be exercised, and
the maturity T of the bond, where T < T. The payoff of the option will
depend on the bond price at T, which in turn depends on uncertain
interest rates.
Mario Dell’Era Quantitative Finance
19. Interest-rate Caps
A cap offers protections against a rise in interest rates. This may be
interesting to someone who wants to borrow money at variable rate.
A cap is a portfolio of caplets, applying to different time intervals in
the future. If L is a notional principal and RK is the cap rate, a caplet
applying to a time interval of length δt gives a payoff:
payoff = L × δt × max(0, R − RK )
where R is the interest rate prevailing for that interval. Should interest
rates rise in the future, the owner of the cap will receive a payoff
covering the payment interest above the cap rate. It can be shown
that caps are equivalent to portfolio of bond options.
Mario Dell’Era Quantitative Finance
20. Interest-rates Floors
A floor is similar to a cap, but it offers protection against a drop in
interest rates. The payoff of a floorlet is
payoff = L × δt × max(0, RK − R)
Mario Dell’Era Quantitative Finance