| Financial Toolbox | Search  Help Desk |
| bdttrans | Examples See Also |
Translate a tree returned by bdtbond.
Syntax
bdttrans(Tree)[TreeMat, TreeTimes] = bdttrans(Tree)
Arguments
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 NaNs
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.
Example
Specify a bond.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 =
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 =
See Also
bdtbond