Financial Toolbox | ![]() ![]() |
bdtbond
Syntax
bdttrans(Tree) [TreeMat, TreeTimes] = bdttrans(Tree)
Tree |
Tree structure returned by bdtbond . |
Description
bdttrans
unpacks and converts a short discount tree structure to a short rate tree, or a price tree structure to a clean price tree. The output is a matrix of tree node values and a vector of node times.
TreeMat
is an NSTATES
-by-NTIMES
converted matrix of short rate or clean price values at points on the tree. Time layers are columns containing the different states. Unused entries of the matrix are screened with NaN
.
TreeTimes
is a 1-by-NTIMES
vector of times corresponding to layers of TreeMat
.
If bdttrans
is called without output arguments, it plots the translated tree against the time axis in coupon intervals.
OptBond.Settle = '15-Jul-1996'; OptBond.Maturity = '15-Jan-1998'; OptBond.CouponRate = 0.07; OptBond.Period = 2;Specify an embedded American call option. Make the bond callable by the issuer between 15-Jan-1997 and maturity.
OptBond.CallType = 1; OptBond.CallStartDate = '15-Jan-1997'; OptBond.CallExpiryDate = '15-Jan-1998'; OptBond.CallStrike = 101;Build constant zero curve structure.
ZeroCurve.ZeroRates = 0.05; ZeroCurve.CurveDates = '15-Jul-1996';Build constant volatility curve structure.
VolCurve.VolatilityRates = 0.15; VolCurve.CurveDates = '15-Jul-1996';Choose two tree nodes per whole coupon period.
Accuracy = 2;Run the
bdtbond
function.
[Price, Sensitivities, DiscTree, PriceTree] = bdtbond(OptBond,... ZeroCurve, VolCurve, Accuracy);Convert the discount tree to a short rate tree.
DiscTree = Values: [6x7 double] Times: [0 0.5000 1 1.5000 2 2.5000 3] Dates: [729221 729313 729405 729496 729586 729678 729770] ErrorFlag: 0 Type: 'Short Discount' Frequency: 2 [ShortRateMat, TreeTimes] = bdttrans(DiscTree) ShortRateMat =Convert the price tree to a clean price tree.0.0500 0.0500 0.0447 0.0399 0.0357 0.0319 0.0285
NaN NaN 0.0554 0.0494 0.0442 0.0395 0.0353
NaN NaN NaN 0.0613 0.0548 0.0489 0.0437
NaN NaN NaN NaN 0.0679 0.0607 0.0542
NaN NaN NaN NaN NaN 0.0753 0.0672
NaN NaN NaN NaN NaN NaN 0.0835
TreeTimes = 0 0.5000 1.0000 1.5000 2.0000 2.5000 3.0000
PriceTree = Values: [6x7 double] Times: [0 0.5000 1 1.5000 2 2.5000 3] Dates: [729221 729313 729405 729496 729586 729678 729770] ErrorFlag: 0 AccrInt: [0 1.7500 0 1.7597 0 1.7500 0] Coupons: [0 0 3.5000 0 3.5000 0 3.5000] Type: 'Price' [CleanPriceMat, TreeTimes] = bdttrans(PriceTree) CleanPriceMat =101.9512 101.4677 101.0000 101.0000 101.0000 100.9348 100.0000
NaN NaN 101.0000 101.0000 101.0000 100.7429 100.0000
NaN NaN NaN 100.6019 100.7397 100.5060 100.0000
NaN NaN NaN NaN 100.0978 100.2139 100.0000
NaN NaN NaN NaN NaN 99.8539 100.0000
NaN NaN NaN NaN NaN NaN 100.0000
TreeTimes = 0 0.5000 1.0000 1.5000 2.0000 2.5000 3.0000
See Also
bdtbond
![]() | bdtbond | beytbill | ![]() |