Exercise Sheet 5

Exercise Sheet 5 - Solution
Alessandro Gnoatto
November 24, 2014
1
Solution to Exercise 1
It is possible to prove the result in two ways:
1.1
Version 1 of the proof
From the definition of the forward rate we have, for a single payment of the
floater at time Ti+1
Vfiloater (Ti+1 ) = N L(Ti , Ti+1 ; Ti+1 )(Ti+1 − Ti )
=N
P (Ti ; Ti ) − P (Ti+1 ; Ti )
P (Ti+1 ; Ti )
Such a payment is FTi -measurable, hence the value, as observed from time Ti ,
is a multiple of P (Ti+1 ; Ti ), i.e.
Vfiloater (Ti ) = N (P (Ti ; Ti ) − P (Ti+1 ; Ti ))
and the corresponding value at time t is
Vfiloater (t) = N (P (Ti ; t) − P (Ti+1 ; t))
The result follows by summing over i.
1.2
Version 2 of the proof
By choosing N (t) = P (Ti+1 ; t) as numeraire, we can write the value of a floater
with a single cashflow as
P (Ti ; Ti ) − P (Ti+1 ; Ti ) i
QN
Vf loater (t) = N (t)E
N
Ft
N (Ti )
P (Ti ; t) − P (Ti+1 ; t)
N
= N (t)
N (t)
= N (P (Ti ; t) − P (Ti+1 ; t))
and again the result follows by summing over i.
1
2
Solution to Exercise 2
The time t value of a European Swaption with strike price K, maturity T1 ,
notional N , may be computed by means of the following conditional expectation
with respect to the risk neutral measure with associated numeraire N (t) (to be
specified).
!+ 
(L(Ti , Ti+1 ; T1 ) − K) (Ti+1 − Ti )P (Ti+1 ; Ti ) Ft 
Vswaption (t) = N (t)EQ
i=1

!+ 
n−1
X
N
N
(t)
= N EQ 
P (T1 , T1 ) − P (Tn ; T1 ) − K
(Ti+1 − Ti )P (Ti+1 ; Ti )) Ft 
N (T1 )
i=1
N
N (t)
+
= N EQ
A(T1 , ..., Tn ; T1 ) (S(T1 ) − K)) Ft
N (T1 )

N
n−1
X
 N
N (T1 )
where
A(T1 , ..., Tn ; t) :=
n−1
X
(Ti+1 − Ti )P (Ti+1 ; t))
i=1
S(t) :=
P (T1 ; t) − P (Tn ; t)
A(T1 , ..., Tn ; t)
Notice that the process A(T1 , ..., Tn ; t), as a a linear combination (portfolio) of
traded assets, is a traded asset, hence may serve as a numeraire. Notice also that
the process S(·) represents a relative price of a portfolio of zero coupon bonds
in terms of the numeraire A(T1 , ..., Tn ; ·), hence, by choosing A(T1 , ..., Tn ; ·) as
numeraire, the process S(·) is a martingale. Hence we can rewrite the conditional
expectation as follows
swap
Vswaption (t) = N A(T1 , ..., Tn ; t)EQ
h
i
+
(S(T1 ) − K) Ft
By assumption the par swap rate S follows a lognormal diffusion under the
physical measure P. Under the measure Qswap1 in stead we have
swap
dS(t)
= σ(t)dW Q
,
S(t)
S(0) =
P (T1 ; 0) − P (Tn ; 0)
.
A(T1 , ..., Tn ; 0)
Since the underlying of the contract follows a driftless GBM, we can readily
apply the Black formula to evaluate the conditional expectation. Let us define
s
σ
¯ (t, T ) :=
1 We
1
T −t
Z
T
σ 2 (s)ds
t
are implicitly assuming that the application of Girsanov theorem is justified.
2
Then the price of the swaption is given by
Vswaption (t) = N A(T1 , ..., Tn ; t) (S(t)φ(d+ ) − Kφ(d− ))
Z x
z2
1
e− 2 dz
φ(x) := √
2π −∞
2
1)
log S(t)
± σ¯ (t,T
(T1 − t)
K
2
√
d± :=
σ
¯ (t, T1 ) T1 − t
3
Solution to Exercise 3
Let us start by recalling the payoff of a digital caplet, given by
Vdigital (T2 ) = N 1{L(T1 ,T2 ;T1 )−K>0} (T2 − T1 ).
We observe that the payoff, paid at time T2 is FT1 -measurable. The value at
time T1 is simply obtained by discounting:
Vdigital (T1 ) = N 1{L(T1 ,T2 ;T1 )−K>0} (T2 − T1 )P (T2 ; T1 ).
As in the case of the plain vanilla caplet, we use the T2 -bond as numeraire,
i.e. we set N (t) = P (T2 ; t), hence, by assuming that the Libor rate follows a
Lognormal process, we have again that the corresponding dynamics are driftless
under QN . In particular, under the measure QN , the distribution of the log-libor
rate is
σ
¯ 2 (0, t)
(1) log L(T1 , T2 ; t) ∼ N log(L(T1 , T2 ; 0)) −
t, σ
¯ 2 (0, t)t .
2
An application of the risk neutral valuation formula under the measure QN
yields
1
QN
Vdigital (t) = N N (t)E
1{L(T1 ,T2 ;T1 )−K>0} (T2 − T1 )P (T2 ; T1 ) Ft
N (T1 )
N = N P (T2 ; t)(T2 − T1 )EQ 1{L(T ,T ;T )−K>0} Ft
1
2
1
= N P (T2 ; t)(T2 − T1 )φ(d− ),
where in the last step we used (1).
4
Solution to Exercise 4
The test class net.finmath.tests.marketdata.curves.CalibrationTest provides some examples concerning the construction of interest rate curves. The
method testCurvesAndCalibration constructs an interest rate curve by providing as input parameters an array of zero coupon bond maturities and an
associated array of zero coupon bond prices. The instantiation of the curve also
allows to specify different interpolation methods, extrapolation methods
and interpolation entities.
In this case a discount curve is an array of zero-coupon bond prices which are
suitably interpolated/extrapolated starting from the data which were provided
to the constructor of the class.
3
The following Java class provides an example of the instantiation of a discount curve by means of prices of zero coupon bonds. Test different interpolation/extrapolation/interpolation entities.
package net . finmath . marketdata . model . curves ;
2
import java . text . DecimalFormat ;
4
6
8
import net . finmath . marketdata . model . curves . Curve .
ExtrapolationMethod ;
import net . finmath . marketdata . model . curves . Curve .
InterpolationEntity ;
import net . finmath . marketdata . model . curves . Curve .
InterpolationMethod ;
import net . finmath . time . T i m e D i s c r e t i z a t i o n ;
import net . finmath . time . T i m e D i s c r e t i z a t i o n I n t e r f a c e ;
10
public c l a s s B a s i c D i s c o u n t C u r v e T e s t {
12
14
16
18
20
22
s t a t i c f i n a l DecimalFormat format terReal2 = new
DecimalFormat ( " 0.00 " ) ;
s t a t i c f i n a l DecimalFormat format terReal6 = new
DecimalFormat ( " 0.000000 " ) ;
public s t a t i c void main ( String [] args ) {
/∗
∗
∗
∗
∗
∗
24
26
28
30
32
34
36
38
40
42
44
46
48
Try changing the methodologies....
InterpolationMethod.LINEAR,
−> How do we
interpolate?
ExtrapolationMethod.CONSTANT
−> How do we
extrapolate?
InterpolationEntity.LOG_OF_VALUE −> What are we
interpolating?
∗/
DiscountCurve discountCurve = DiscountCurve .
createDiscountCurveFromDiscountFactors (
" discountCurve "
/∗ name ∗/ ,
new double [] {0.08 ,
0.17 ,
0.50 ,
2.00 ,
3.00 ,
5.00 ,
7.00 ,
9.00 ,
10.00} /∗ maturities ∗/ ,
new double [] {0.9966722161 ,
0.9933555063 ,
0.9801986733 ,
0.9231163464 ,
0.8869204367 ,
0.8187307531 ,
0.7557837415 ,
0.6976763261 ,
0.670320046} /∗ discount factors ∗/
);
DiscountCurve discou ntCurve 2 = DiscountCurve .
createDiscountCurveFromDiscountFactors (
4
50
52
54
56
58
60
62
64
66
68
70
" discountCurve "
/∗ name ∗/ ,
new double [] {0.08 ,
0.17 ,
0.50 ,
2.00 ,
3.00 ,
5.00 ,
7.00 ,
9.00 ,
10.00} /∗ maturities ∗/ ,
new double [] {0.9966722161 ,
0.9933555063 ,
0.9801986733 ,
0.9231163464 ,
0.8869204367 ,
0.8187307531 ,
0.7557837415 ,
0.6976763261 ,
0.670320046} , /∗ discount factors ∗/
I n t e r p o l a t i o n M e t h o d . CUBIC_SPLINE ,
E x t r a p o l a t i o n M e t h o d . LINEAR ,
I n t e r p o l a t i o n E n t i t y . LOG_OF_VALUE
);
72
74
76
78
System . out . println ( " Given a discount curve : " ) ;
System . out . println ( discountCurve . toString () ) ;
double deltaT = 0.1;
double finalHorizon = 20;
80
T i m e D i s c r e t i z a t i o n I n t e r f a c e t i m e D i s c r e t i z a t i o n = new
T i m e D i s c r e t i z a t i o n (0 , ( i n t ) ( finalHorizon / deltaT ) ,
deltaT ) ;
82
84
double disc ountFact or ;
double d is co un t Fa ct or 2 ;
double time ;
86
88
System . out . println ( " Interpolation and extrapolation of a
discount curve " ) ;
System . out . println ( " We take as given a set of discount
factors " ) ;
System . out . println ( " The default interpolation and
extrapolation method provide us with the whole curve " )
;
90
92
94
96
98
100
System . out . println ( " " ) ;
System . out . println ( " Maturity " + " \ t " + " Discount Factor " )
;
f o r ( i n t timeIndex = 0; timeIndex < t i m e D i s c r e t i z a t i o n .
g e t N u m b e r O f T i m e S t e p s () ; timeIndex ++) {
time = t i m e D i s c r e t i z a t i o n . getTime ( timeIndex ) ;
disco untFact or = discountCurve . g e t D i s c o u n t F a c t o r ( time ) ;
d is co un t Fa ct or 2 = disc ountCurv e2 . g e t D i s c o u n t F a c t o r ( time )
;
System . out . println (
form atterRea l2 . format ( time ) + " \ t " +
5
form atterRea l6 . format ( discou ntFactor ) + " \ t " +
form atterRea l6 . format ( d is c ou nt Fa c to r2 ) + " \ t " +
form atterRea l6 . format ( discou ntFactor d is co un t Fa ct or 2 )
);
102
104
106
}
108
}
110
112
}
Sheet1
Maturity
Default
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
2
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
3
3.1
1
0.995896
0.992173
0.988213
0.984221
0.980199
0.976286
0.972388
0.968507
0.96464
0.960789
0.956954
0.953134
0.949329
0.945539
0.941765
0.938005
0.93426
0.930531
0.926816
0.923116
0.919431
0.915761
0.912105
0.908464
0.904837
0.901225
0.897628
0.894044
0.890475
0.88692
0.88338
Spline Interpolation Difference
0.99963
0.00037
0.995941
-0.000045
0.992219
-0.000045
0.988306
-0.000093
0.98427
-0.000049
0.980199
0
0.976162
0.000123
0.972173
0.000216
0.968226
0.00028
0.96432
0.00032
0.960451
0.000339
0.956615
0.000339
0.95281
0.000324
0.949032
0.000296
0.94528
0.00026
0.941548
0.000216
0.937836
0.000169
0.934139
0.000121
0.930456
0.000075
0.926782
0.000034
0.923116
0
0.919456
-0.000025
0.915802
-0.000041
0.912154
-0.000049
0.908515
-0.000051
0.904886
-0.000049
0.901267
-0.000042
0.89766
-0.000033
0.894066
-0.000022
0.890486
-0.000011
0.88692
0
0.883371
0.000009
1.2
1
0.8
0.6
0.4
0.2
0
-0.2
Page 1
6
Default
Spline Interpolation
Difference