c# pdf library github : Batch pdf metadata control Library platform web page asp.net wpf web browser Wiley%20Advanced%20Modelling%20in%20Finance%20using%20Excel%20and%20VBA23-part595

15
Interest Rate Models
This chapterconcentrates on the valuation of zero-coupon bonds using an interest rate
model. In this approach, changes in the short rate are captured in a stochastic model
which generates a term structure of zero-coupon prices. This approach via an interest
rate model produces analytic solutions for zero-coupon prices. Jamshidian (1989) has
suggested how the zeroprices can be used to value options on zero-coupon bonds and
additionally options on couponbonds.
We look at two leading interest rate models, those of Vasicek (1977) and of Cox,
Ingersoll and Ross (CIR; Cox et al., 1985). Both models assume that the risk-neutral
process forthe (instantaneous)short rate r is stochastic, with one source of uncertainty.
The stochasticprocessincludesdriftandvolatilityparameterswhichdependonly on the
shortrate r, and not ontime. The shortrate model involves a numberofvariables, and
different parameterchoices for these variables will lead to different shapes for the term
structuregeneratedfromthe model.
Bothoftheinterestratemodelsfeature‘so-called’meanreversionoftheshortrate,that
is, atendencyfortheshortratetodriftbacktosomeunderlyingrate.Thisisanobserved
feature of the way interest rates appear to vary. The two models differ in the handling
ofvolatility. WestartwithVasicek’s model, and then considerthe CIR model. Both the
accompanying spreadsheets (the Vasicek and the CIR sheets) in the BOND1 workbook
havethe sameformatanduse the same numerical example.
15.1 VASICEK’S TERM STRUCTURE MODEL
Vasicek’s model forthechangesin shortrater is stochastic andofthe form:
dr DabrdtC
r
dz
Thus a small change (dr)in the short rate in time increment dt includes a drift back to
meanlevelbat rate afortheshortrate. The secondvolatility terminvolves uncertainty,
dz representinganormallydistributed variatewithzeromeanandvariancedt. Theshort
rate r (strictly r(t)) is assumed to be the instantaneous rate at time t appropriate for
continuous compounding.
Whenvaluingoptions on equities, the underlyingapproach is toobtain the discounted
expectedvalueinarisk-neutralworldoftheoptionpayoff.Equivalently, thecurrentvalue
of a share can be viewed as the discounted value in a risk-neutral world of its future
expectedvalue. Exactly the same principleapplies to bonds andbondoptionpayoffs. In
the case of anoption on a zero-coupon bond, the value at timet of1 to be received at
time s canbe expressedas:
Pt,sDE
Q
exp
rudu
1
where the integral is over the time interval from lower limit t to upper limit s and the
notationE
Q
denotes risk-neutralexpectation.
Batch pdf metadata - add, remove, update PDF metadata in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Allow C# Developers to Read, Add, Edit, Update and Delete PDF Metadata
google search pdf metadata; pdf metadata extract
Batch pdf metadata - VB.NET PDF metadata library: add, remove, update PDF metadata in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Enable VB.NET Users to Read, Write, Edit, Delete and Update PDF Document Metadata
edit pdf metadata; acrobat pdf additional metadata
232
AdvancedModellinginFinance
For equity options, interest rates are assumed to be constant so the term involving
the integral of the short rate can be taken outside the expectation, in that it reduces to
the discount factor exp[rst]. Therefore for equity options, valuation depends on
calculatingtherisk-neutralexpectedvalueoftheappropriatepayoff,theinterestrateterm
exp[rst]beingtheconstantdiscount factor.
For options on zero-coupon bonds, the model equation for the short rate has to be
combined into the expectation expression for Pt,s. Because of the probabilistic short
rates, theinterestrate termcannolongerbe factored outside the expectation.
GivenVasicek’s choiceof modelforthe short rate, an analytic solution canbe found
fortheintegralandthus fortheprice ofthezero-coupon bond, namely:
Pt,sDAt,sexp[Bt,srt]
wherert is thevalueofthe shortrater attime t
Bt,sDf1exp[astg/a
At,sDexpf[Bt,sst]a
2
b
r
2
/2g/a
2

r
2
Bt,s
2
/4a
Inthe specialcase whenaD0, the expressions forA andBsimplify to:
Bt,sDst and At,sDexp[
r
2
st
3
/6]
Thesequantitiesaremosteasilycalculatedinaspreadsheet.Figure15.1showsanextract
from the Vasicek sheetofthe BOND1.xlsworkbook.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
A
B
C
D
E
Vasicek Model : see Hull (4th Edition)  p567-9
RN model
dr = a(b-r) dt + 
σ
r
dz
a
0.1779
Zero-coupon bond price
b
0.0866
P(0,s)
0.4867
r
6.00%
via fn
0.4867
0 (nowyr)
0.00
s (zeroyr)
10.00
Zero yield
zero life
10.00
R(0,s)
7.20%
σ
r
2.00%
via fn
7.20%
B(0,s)
4.6722
Zero yield (infinite maturity)
A(0,s)
0.6442
8.02%
Volatility of zero yield
σ
R
(0,s)
0.93%
R(∞)
Figure15.1 Zero-coupon bondprices,zeroyieldsandvolatilitiesforVasicek
Vasicek’s modelrequires the currentvalue ofthe shortrate(r)supplemented with three
parameters (a, band
r
)thatmustbe estimatedfromhistoricdata. As ourbase case, we
usetheparametervalues fora, band
r
thatmatchthose fortheone-monthtreasury bill
yield, estimated using US data from1964 to 1989by Chanetal. (1992).
VB.NET Create PDF from Excel Library to convert xlsx, xls to PDF
C#.NET search text in PDF, C#.NET edit PDF bookmark, C#.NET edit PDF metadata, C#.NET Professional .NET PDF converter component for batch conversion.
change pdf metadata creation date; remove metadata from pdf file
VB.NET PDF Convert to Jpeg SDK: Convert PDF to JPEG images in vb.
PDF pages, C#.NET search text in PDF, C#.NET edit PDF bookmark, C#.NET edit PDF metadata, C#.NET NET components to batch convert adobe PDF files to
read pdf metadata java; pdf metadata viewer
InterestRate Models
233
In the Figure 15.1 example, the initial short rate is 6%, with the underlying rate to
which r reverts of 0.0866(8.66%) incell B6. The model is set up to give zero-coupon
bond prices for up to 10 years ahead (in general s). Cells B13 and B14 contain the
formulas for B0,s and A0,s from which the price of the zero-coupon bond with
maturity s years, P0,s in cellE6, is constructed. This means that Vasicek’s model
evaluates the present value of each unit to be received in s years time (currently sD
10years) at0.4867. From the zero price, the associated zero yield can be derived, here
equalto7.20%.
The yield for a bond with an infinite maturity, denoted R1 in cell E14, is 8.02%.
This value is lowerthan,thoughconnectedto, thechosen value forthe parameterb(the
level to which the short rate reverts). The formula for the volatility ofthe short rate is
givenincellE17,showingthatthe10-yearzeroyieldhasavolatilityof0.93% compared
tothe chosenshort rate volatilityof2%.
It is informative to construct a Data Table, evaluating the zero yield andits volatility
fordifferentvalues ofs from0upto30say. Thecolumnofzeroyields representingthe
termstructure when charted should correspond to the lowest curve in Figure 15.2 (also
seeChart2inthe workbook).
Vasicek−Possible Shapes for Term Structure
5.5%
6.0%
6.5%
7.0%
7.5%
8.0%
8.5%
9.0%
9.5%
0
5
10
15
20
25
30
35
Bond Maturity
Figure 15.2 Termstructure fordifferentvaluesofr
As in Figure 15.2, the term structure of zero yields can take one of three possible
shapes,dependingonthevalueofthecurrentshortrateincell B7.Thepossibleshapesare
monotonicallyincreasing(whenrislessthanR1,humpedormonotonicallydecreasing
(whenr is greaterthanb). Youcan check this bychanging the value ofr andswitching
toChart2intheworkbook.Forexample,bychangingthevalueofr incell B7to9%the
chartshoulddisplaya monotonically decreasingtermstructure, whilst a value of8.05%
forr shouldproduce ahumpedtermstructure.
VB.NET PDF Convert to Tiff SDK: Convert PDF to tiff images in vb.
NET control to batch convert PDF documents to Tiff format in Visual Basic. Qualified Tiff files are exported with high resolution in VB.NET.
remove pdf metadata; batch edit pdf metadata
VB.NET PDF Convert to Word SDK: Convert PDF to Word library in vb.
project. Professional .NET library supports batch conversion in VB.NET. .NET control to export Word from multiple PDF files in VB.
clean pdf metadata; pdf xmp metadata editor
234
AdvancedModellinginFinance
One problem with Vasicek’s interest rate model is that sometimes it gives rise to
negativeshortrates.SeeanexampleinFigure15.3whichshowsasimulationofVasicek’s
model with aD0.3 in cellB5. This problem does not arise with the CIR interest rate
model.However,beforeinvestigatingthisalternativemodelforinterestrates,thevaluation
ofoptions onzero-couponbonds is explored.
short rate
-2%
-1%
0%
1%
2%
3%
4%
5%
6%
7%
0
1
2
3
4
5
6
7
8
9
10
Figure15.3 One simulation ofshortratesgivenby Vasicek’smodel
15.2 VALUING EUROPEAN OPTIONS ON ZERO-COUPON
BONDS, VASICEK’S MODEL
The formula for the valuation of options on zero-coupon bonds in the Vasicek sheet is
due to Jamshidian (1989). Jamshidian’s formula is bestviewed as an application of the
lognormal option formula seen previously in section 13.1. [The only difference in the
formula is the replacement of the discount factor exprT with the equivalent zero-
coupon bond price P0,T.] His contribution was to determine formulas for M and V
correspondingtotheforwardbond priceon whichthe optionis based.
The priceattime 0 ofa Europeancall with exerciseprice X expiring at time T on a
zero-couponbond with maturitys andprincipalL is:
cDP0,T[expMC0.5VNd
1
XNd
2
]
where:
MDln[LP0,s/P0,T]0.5
p
2
VD
p
2
d
2
D[MlnX]/
p
V
d
1
Dd
2
C
p
V
p
Dv0,TBT,s
VB.NET PDF File Merge Library: Merge, append PDF files in vb.net
Batch merge PDF documents in Visual Basic .NET class program. Merge two or several separate PDF files together and into one PDF document in VB.NET.
pdf remove metadata; batch pdf metadata editor
C# PDF Convert to Tiff SDK: Convert PDF to tiff images in C#.net
Studio .NET project. Powerful .NET control to batch convert PDF documents to tiff format in Visual C# .NET program. Free library are
metadata in pdf documents; search pdf metadata
InterestRate Models
235
v0,TD
r
f[1exp2aT]/2ag
BT,sDf1exp[asT]g/a
Note thatwhen aD0, the volatility componentv0,T simplifies to 
r
p
Tand BT,s
tosT.
Figure 15.4 shows the calculations to get the option value. The two prices for zero-
coupon bonds P0,T and P0,s have been evaluated in cells E27 and E28, here via
theuser-definedfunctionVasicekCIRZeroValue.(TheycanalsobeobtainedfromcellE6
withthe appropriatematuritytimes.)There are intermediatecalculationsforvolatility
P
andforMandVinthespreadsheet.Theresultingvalueofthecallmaturinginfouryears
onthe10-yearzero-couponbondis0.037incellH26. InH27,thesameresultisobtained
viaa seconduser-definedfunction.
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
A
B
C
D
E
F
G
H
Valuing European Options on Zero-Coupon Bonds (Jamshidian)
a
0.1779
Bond Face Value (L)
1.00
iopt
1
b
0.0866
Option Exercise Price (X)
0.60
option
call
r
6.00%
Option value
0.037
0 (nowyr)
0.00
P(0,T)
0.7652
via fn
0.037
T (optyr)
4.00
P(0,s)
0.4867
s (zeroyr)
10.00
v(0,T)
0.0292
M
-0.4583
B(T,s)
3.6880
V
0.0116
σ
r
2.00%
σ
p
10.77%
d
1
0.5953
d
2
0.4876
N (d
1
)
0.7242
N (d
2
)
0.6871
Figure 15.4 Jamshidian’svaluationfora zero-couponbond
Increasing the short rate volatility (in cellB11)from 2% upto 4% increases the option
valueto0.076.
15.3 VALUING EUROPEAN OPTIONS ON COUPON BONDS,
VASICEK’S MODEL
Jamshidianalsoderivedamoregeneralmethodforvaluingoptionsoncouponbonds.The
key insight is that an option on a coupon bond can be decomposed into separate zero-
couponoptionsoneachofthecashflowsfromthebonddueaftertheexpiryoftheoption.
Withourexampleofafour-yearoptionona10-yearbondwithannualcoupons,therewill
be couponsforyears 5to10toconsider, togetherwiththereturnofthebondface value
inyear10. InFigure15.5, the relevantcashflows(Lj)areshownincells E51toE56, in
total1.30(thesumofthe face value andthesix coupons fromthe bond afterthe expiry
oftheoption). We needtofindaninterestrate (sayr
Ł
)thatreduces thepresentvalue of
these payments to match the exercise price of the option (0.6 in cellE43). Finding the
C# PDF Convert to Word SDK: Convert PDF to Word library in C#.net
Powerful components for batch converting PDF documents in C#.NET program. Convert PDF to multiple MS Word formats such as .doc and .docx.
pdf metadata reader; pdf metadata
C# PDF File Merge Library: Merge, append PDF files in C#.net, ASP.
NET components for batch combining PDF documents in C#.NET class. Powerful library dlls for mering PDF in both C#.NET WinForms and ASP.NET WebForms.
edit pdf metadata; c# read pdf metadata
236
AdvancedModellinginFinance
valueofr
Ł
isamatteroftrialanderror,hereaccomplishedwiththeuser-definedfunction
namedJamshidianrstar.
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
A
B
C
D
E
F
G
H
Valuing European Options on Coupon-Bearing Bonds (Jamshidian)
a
0.1779
Bond Face Value (L)
1.00
iopt
1
0.0866
Bond Coupon (cL)
0.05
option
call
r
6.00%
Option Exercise Price (X)
0.60
0 (nowyr)
0.00
Option value
0.206
T (optyr)
4.00
via fn
0.206
s (zeroyr)
10.00
r* via fn
18.30%
(coupyr)
1.00
r* exercise price
0.60
σ
r
2.00%
T
sj
P(r*,T,sj)
LjStrike (Xj)
Option values
1
4.0
5.0
0.8396
0.05
0.0420
0.00
2
4.0
6.0
0.7154
0.05
0.0358
0.01
3
4.0
7.0
0.6172
0.05
0.0309
0.01
4
4.0
8.0
0.5382
0.05
0.0269
0.01
5
4.0
9.0
0.4735
0.05
0.0237
0.01
6
4.0
10.0
0.4198
1.05
0.4408
0.17
Figure15.5 Valuingoptionsoncoupon-payingbondsusingJamshidian’sapproach
Youcanconfirmthatthecalculatedvalueforr
Ł
(18.30%incell E46)doesensurethatthe
present value ofthe bond payments (summed incell E47)agrees withthe chosenstrike
price for the option in cell E43. The value ofthe option on the coupon bond is simply
the sum of the values ofthe separate zero-coupon options–the separate options use the
appropriatevaluesofLj,XjandsjintheVasicekZeroOptionValuefunction.Notethough
that the interest rate used for the separate option values is the original short rate (here
6%)ratherthanr
Ł
.
15.4 CIR TERM STRUCTURE MODEL
ThemaindifferencebetweentheVasicekandtheCIRmodelsisthewaythatthevolatility
oftheshortrateismodelled.IntheCIRmodel,volatilitydependsalsoonthesquareroot
ofthe shortrateand this ensures thattheshortrate doesnotgo negative.
Hence in the CIR model, the risk-neutral process for the short rate is a stochastic
process ofthe form:
dr DabrdtC
p
rdz
Hereweseethatthevolatilityoftheshortrate[
r
D
p
r]increaseswiththesquareroot
oftheleveloftheshortrate. This modelpreventstheoccurrenceofnegativeinterestrates
(as long as the parametervalues satisfytherelationship2ab 
2
).
Figure15.6 shows theCIRmodel forpricingzero-couponbondsinthe CIR sheet.As
canbeseen, the layouthereandthroughout the sheetis similarto the Vasicek sheet.
InterestRate Models
237
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
A
B
C
D
E
Cox, Ingersoll and Ross Model : see Hull (4th edition) p570
RN model
a
0.2339
Zero-coupon bond price
b
0.0808
P(0,s)
0.4926
r
6.00%
via fn
0.4926
0 (nowyr)
0.00
s (zeroyr)
10.00
Zero yield
zero life
10.00
R(0,s)
7.08%
σ
0.0854
via fn
7.08%
γ
0.2633
Zeroyield(infinite maturity)
y)
12.9108
R(∞)
7.60%
B(0,s)
3.7178
A(0,s)
0.6156
Volatility of zero yield
0.78%
exp(γ(s-0))-1
σ
R
(0,s)
dr = a(b-r) dt + σ sqrt(r) dz
Figure 15.6 Zero-couponbondprices,zero yieldsandvolatilitiesforCIRmodel
Cox,IngersollandRossshowedthatbondpriceshavethesamegeneralformasinVasicek,
theformulafor the priceofa zero-couponbondpaying1at times, Pt,s, being:
Pt,sDAt,sexp[Bt,srt]
wherert is the value of r attime t. The functions B0,s and A0,s have somewhat
different forms, which involve a new parameter, . Using the CIR interest rate model,
the 10-year zero-coupon bond is valued at 0.4926, the 10-year zero yieldbeing 7.08%.
Once again, via a Data Table the zeroyields can be plotted fordifferentvalues ofs, as
inChart3oftheworkbook. Thesame rangeofpossible shapesforthetermstructure can
be achieved aswithVasicek.
15.5 VALUING EUROPEAN OPTIONS ON ZERO-COUPON
BONDS, CIR MODEL
To value a CIR zero-coupon option requires the calculation of the distribution func-
tion of the non-central chi-squared distribution (instead of the normal distribution used
in Black–Scholes and in Vasicek’s pricing formula). Since the CIR formula is rather
complicated and thus normally omitted from textbooks, we preferto see our main task
as ensuring that the formulas in the spreadsheet and the associated function return the
correct values. Those ofa brave dispositionare very welcome to delveintothe original
CIR paper, as well as the paper by Schroder (1989) in which he gives an approxima-
tionforthenecessarydistributionfunction.Figure15.7showstheprocedures forvaluing
options onzero-couponbonds,thevalueofthefour-yearcallonthe10-yearzero-coupon
bondbeing0.040(incell H26).ThissamevalueisobtainedincellH27viaauser-defined
function.
238
AdvancedModellinginFinance
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
A
B
C
D
E
F
G
H
Valuing European Options on Zero-Coupon Bonds (CIR)
a
0.2339
Bond Face Value (L)
1.00
iopt
1
b
0.0808
Option Exercise Price (X)
0.60
option
call
r
6.00%
Option value
0.040
0 (nowyr)
0.00
P(0,T)
0.7660
via fn
0.040
T (optyr)
4.00
P(0,s)
0.4926
s (zeroyr)
10.00
chi1
0.8079
calc1
2.4421
chi2
0.7794
σ
0.0854
A(T,s)
)
0.8012
c11
20.14
B(T,s)
3.1555
c2
10.36
γ
0.2633
φ
38.6449
c31
4.67
ψ
68.1050
c12
19.56
r*
0.0916
c2
10.36
c32
4.81
Figure15.7 Valuingoptionsonzero-couponbondsusing CIRmodel
15.6 VALUING EUROPEAN OPTIONS ON COUPON BONDS,
CIR MODEL
We value options on coupon bonds with the CIR model using the approach suggested
by Jamshidian, usedearlier in the chapterwith theVasicekmodel. Again, theoption on
the coupon bond can be viewed as separate options on the cash flows between option
expiryand bond maturity. Each oftheseparate options canbe valued as an optionon a
zero-couponbond.Jamshidian’scontributionisinfindinganinterestrater
Ł
suchthatthe
sumofthe exercise prices ofthe separate options equals the exerciseprice ofthe option
on the couponbond.
Figure15.8 shows the procedure. The interest rate in cellE47 is 20.31%, evaluated
using the Jamshidianrstar function. The value of the option on the coupon bond is the
sumoftheindividualoptionsontheseparatezero-couponbonds,thefinalcallvaluebeing
0.212 incellH44.(Under Vasicek’s model, the option value was slightlylowerat0.206
in Figure 15.5.)
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
A
B
C
D
E
F
G
H
Valuing European Options on Coupon-Bearing Bonds (Jamshidian)
a
0.2339
Bond Face Value (L)
1.00
iopt
1
0.0808
Bond Coupon (cL)
0.05
option
call
r
6.00%
Option Exercise Price (X)
0.60
0 (nowyr)
0.00
Option value
0.212
T (optyr)
4.00
γ
0.2633
via fn
0.212
s (zeroyr)
10.00
(coupyr)
1.00
r* via fn
20.31%
σ
0.0854
r* exercise price
e
0.60
T
sj
P(r*,T,sj)
LjStrike (Xj)
Option values
1
4.0
5.0
0.8273
0.05
0.0414
0.00
2
4.0
6.0
0.7008
0.05
0.0350
0.01
3
4.0
7.0
0.6051
0.05
0.0303
0.01
4
4.0
8.0
0.5306
0.05
0.0265
0.01
5
4.0
9.0
0.4710
0.05
0.0236
0.01
6
4.0
10.0
0.4222
1.05
0.4433
0.18
Figure15.8 Valuingoptionsoncoupon-payingbondsusingJamshidian’sapproach
InterestRate Models
239
15.7 USER-DEFINED FUNCTIONS IN Module1
Since the Vasicek and CIR models share common elements, it makes sense to write a
single function, allowing both the Vasicek (with imodD1) and the CIR (with imodD2)
calculations. Incommonwiththespreadsheet,thefunctionalsoallows forthe casewhen
aD0 by using Ifstatements:
FunctionVasicekCIRZeroValue(imod,a,b,r,nowyr,zeroyr,sigma)
’ returnstheVasicek(imod=1)orCIR(imod=2)zero-couponbondvalue
Dimsyr,sig2,Asyr,Bsyr,rinf,gamma,c1,c2
syr=zeroyr-nowyr
sig2=sigmaO2
Ifimod=1Then
Ifa=0Then
Bsyr=syr
Asyr=Exp((sig2
Ł
syrO3)/6)
Else
Bsyr=(1-Exp(-a
Ł
syr))/a
rinf=b-0.5
Ł
sig2/(aO2)
Asyr=Exp((Bsyr-syr)
Ł
rinf-((sig2
Ł
BsyrO2)/(4
Ł
a)))
EndIf
ElseIfimod=2Then
gamma=Sqr(aO2+2
Ł
sig2)
c1=0.5
Ł
(a+gamma)
c2=c1Ł (Exp(gammaŁ syr)-1)+gamma
Bsyr=(Exp(gamma
Ł
syr)-1)/c2
Asyr=((gamma
Ł
Exp(c1
Ł
syr))/c2)O(2
Ł
a
Ł
b/sig2)
EndIf
VasicekCIRZeroValue=Asyr
Ł
Exp(-Bsyr
Ł
r)
EndFunction
The followingfunction incorporates the required zeroprices usingthe above function
andthenproceeds tocalculatethelognormalparameters MandV. The subsequent lines
ofcode arethesameas fortheLNOptionValue0functioninOPTION2.xls, withthezero
price replacingthediscountfactor:
FunctionVasicekZeroOptionValue(iopt,L,X,a,b,r,nowyr,optyr,zeroyr,sigma)
’ returnstheVasicekzero-couponbondoptionvalue
’ usesVasicekCIRZeroValuefn
DimP0T,P0s,v0T,BTs,sigmap,M,V,d2,d1,Nd1,Nd2
P0T=VasicekCIRZeroValue(1,a,b,r,nowyr,optyr,sigma)
P0s=VasicekCIRZeroValue(1,a,b,r,nowyr,zeroyr,sigma)
Ifa=0Then
v0T=sigma
Ł
Sqr(optyr-nowyr)
BTs=zeroyr-optyr
Else
v0T=Sqr(sigmaO2
Ł
(1-Exp(-2
Ł
a
Ł
(optyr-nowyr)))/(2
Ł
a))
BTs=(1-Exp(-a
Ł
(zeroyr-optyr)))/a
EndIf
sigmap=v0TŁ BTs
M=Log(L
Ł
P0s/P0T)-0.5
Ł
sigmap
Ł
2
V=sigmapO2
d2=(M-Log(X))/Sqr(V)
d1=d2+Sqr(V)
Nd1=Application.NormSDist(iopt
Ł
d1)
240
AdvancedModellinginFinance
Nd2=Application.NormSDist(iopt
Ł
d2)
VasicekZeroOptionValue=P0T
Ł
iopt
Ł
(Exp(M+0.5
Ł
V)
Ł
Nd1-X
Ł
Nd2)
EndFunction
The followingfunction is attempting to vary the interest rate when used tovalue the
payments fromthe coupon bond payable afterthe option matures inorderto match the
exercise price of the option. In the absence of an analytic formula for the slope, we
approximatetheslope byusinga difference formula:
FunctionJamshidianrstar(imod,L,cL,X,a,b,rtest,optyr,zeroyr,coupyr,sigma,radj)
’ replicatesGoalSeektofindrstarinVasicekorCIRcouponoptionvalue
’ usesVasicekCIRBondnpvfn
Dimatol,rnow,fr1,fr,fdashr
atol=0.0000001
rnow=rtest
Do
fr1=VasicekCIRBondnpv(imod,L,cL,a,b,rnow+radj,optyr,zeroyr,coupyr,sigma)-X
fr=VasicekCIRBondnpv(imod,L,cL,a,b,rnow,optyr,zeroyr,coupyr,sigma)-X
fdashr=(fr1-fr)/radj
rnow=rnow-(fr/fdashr)
LoopWhileAbs(fr)>atol
Jamshidianrstar=rnow
EndFunction
The formula underlying the approximation of the distribution function for the non-
central chi-squared distribution can be seenin the Schroder paper. [However, note that
his equation(10)gives c3in the function ratherthanthecorrectNc3.]
FunctionCIRSankaranQ(z,nu,kappa)
’ componentforCIROptionValuation(seeSchroder)
Dimn,k,h,p,m,c1,c2,c3
n=nu
k=kappa
h=1-(2/3)
Ł
(n+k)
Ł
(n+3
Ł
k)/(n+2
Ł
k)O2
p=(n+2
Ł
k)/(n+k)O2
m=(h-1)
Ł
(1-3
Ł
h)
c1=1-h+0.5
Ł
(2-h)
Ł
m
Ł
p
c2=1-h
Ł
p
Ł
c1-(z/(n+k))Oh
c3=c2/(h
Ł
Sqr(2
Ł
p
Ł
(1+m
Ł
p)))
CIRSankaranQ=Application.NormSDist(c3)
EndFunction
SUMMARY
Theinterestrate models ofVasicek and CIR were theearliestattempts to model interest
rates and so generate a possible term structure (via analytic solutions for zero-coupon
bondprices).Theultimategoalwastoprovideanalyticsolutionsallowingthevaluationof
options onzero-couponbonds,andtherebyimproveonadaptationsoftheBlack–Scholes
approachthatessentiallyignoredthetermstructure. Byvaryingthechoiceofparameters,
boththemodels cangeneratea varietyofpatterns forthe termstructure.The CIR model
explicitly links the volatility of interest rates to their level, a feature that is missing in
Vasicek’s model.Jamshidianshowedhowtheformulasforoptionsonzero-couponbonds
Documents you may be interested
Documents you may be interested