| Financial Derivatives Toolbox™ | ![]() |
Instrument prices from Black-Karasinski interest-rate tree
[Price, PriceTree] = bkprice(BKTree,
InstSet, Options)
BKTree | Interest-rate tree structure created by bktree. |
InstSet | Variable containing a collection of NINST instruments. Instruments are categorized by type. Each type can have different data fields. The stored data field is a row vector or string for each instrument. |
Options | (Optional) Derivatives pricing options structure created with derivset. |
[Price, PriceTree] = bkprice(BKTree, InstSet, Options) computes arbitrage-free prices for instruments using an interest-rate tree created with bktree. All instruments contained in a financial instrument variable, InstSet, are priced.
Price is a number of instruments (NINST)-by-1 vector of prices for each instrument. The prices are computed by backward dynamic programming on the interest-rate tree. If an instrument cannot be priced, NaN is returned.
PriceTree is a MATLAB® structure of trees containing vectors of instrument prices and accrued interest, and a vector of observation times for each node.
PriceTree.PTree contains the clean prices.
PriceTree.AITree contains the accrued interest.
PriceTree.tObs contains the observation times.
bkprice handles instrument types: 'Bond', 'CashFlow', 'OptBond', 'OptEmBond', 'Fixed', 'Float', 'Cap', 'Floor', 'Swap'. See instadd to construct defined types.
Related single-type pricing functions are
bondbybk: Price a bond from a Black-Karasinski tree.
capbybk: Price a cap from a Black-Karasinski tree.
cfbybk: Price an arbitrary set of cash flows from a Black-Karasinski tree.
fixedbybk: Price a fixed-rate note from a Black-Karasinski tree.
floatbybk: Price a floating-rate note from a Black-Karasinski tree.
floorbybk: Price a floor from a Black-Karasinski tree.
optbndbybk: Price a bond option from a Black-Karasinski tree.
optembndbybk: Price a bond with embedded option by a Black-Karasinski tree.
swapbybk: Price a swap from a Black-Karasinski tree.
swaptionbybk: Price a swaption from a Black-Karasinski tree.
Load the BK tree and instruments from the data file deriv.mat. Price the cap and bond instruments contained in the instrument set.
load deriv.mat;
BKSubSet = instselect(BKInstSet,'Type', {'Bond', 'Cap'});
instdisp(BKSubSet)
Index Type CouponRate Settle Maturity Period Name ...
1 Bond 0.03 01-Jan-2004 01-Jan-2007 1 3% bond
2 Bond 0.03 01-Jan-2004 01-Jan-2008 2 3% bond
Index Type Strike Settle Maturity CapReset... Name ...
3 Cap 0.04 01-Jan-2004 01-Jan-2008 1 4% Cap
[Price, PriceTree] = bkprice(BKTree, BKSubSet);
Price =
98.1096
95.6734
2.2706
You can use treeviewer to see the prices of these three instruments along the price tree.
treeviewer(PriceTree, BKSubSet)

bksens, bktree, instadd, intenvprice, intenvsens
![]() | bdtvolspec | bksens | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |