bksens

Instrument prices and sensitivities from Black-Karasinski interest-rate tree

Syntax

[Delta,Gamma,Vega,Price] = bktsens(BKTree,InstSet)
[Delta,Gamma,Vega,Price] = bksens(___,Options)

Description

example

[Delta,Gamma,Vega,Price] = bktsens(BKTree,InstSet) computes instrument sensitivities and prices for instruments using an interest-rate tree created with the bktree function. All sensitivities are returned as dollar sensitivities. To find the per-dollar sensitivities, divide by the respective instrument price.

bksens handles instrument types: 'Bond', 'CashFlow', 'OptBond', 'OptEmBond', 'OptEmBond', 'OptFloat', 'OptEmFloat', 'Fixed', 'Float', 'Cap', 'Floor', 'RangeFloat', 'Swap'. See instadd for information on instrument types.

example

[Delta,Gamma,Vega,Price] = bksens(___,Options) adds an optional input argument for Options.

Examples

collapse all

Load the tree and instruments from the deriv.mat data file.

load deriv.mat; 
BKSubSet = instselect(BKInstSet,'Type', {'Bond', 'Cap'}); 

instdisp(BKSubSet)
Index Type CouponRate Settle         Maturity       Period Basis EndMonthRule IssueDate FirstCouponDate LastCouponDate StartDate Face Name    Quantity
1     Bond 0.03       01-Jan-2004    01-Jan-2007    1      0     1            NaN       NaN             NaN            NaN       100  3% bond 20      
2     Bond 0.03       01-Jan-2004    01-Jan-2008    1      0     1            NaN       NaN             NaN            NaN       100  3% bond 15      
 
Index Type Strike Settle         Maturity       CapReset Basis Principal Name   Quantity
3     Cap  0.04   01-Jan-2004    01-Jan-2008    1        0     100       4% Cap 10      
 

Compute Delta and Gamma for the cap and bond instruments contained in the instrument set.

[Delta, Gamma] = bksens(BKTree, BKSubSet)
Delta = 3×1

 -285.7151
 -365.7048
  189.5319

Gamma = 3×1
103 ×

    0.8456
    1.4345
    6.9999

Input Arguments

collapse all

Interest-rate tree structure, specified by using bktree.

Data Types: struct

Instrument variable containing a collection of NINST instruments, specified using instadd. Instruments are categorized by type; each type can have different data fields. The stored data field is a row vector or character vector for each instrument.

Data Types: struct

Derivatives pricing options structure, created using derivset.

Data Types: struct

Output Arguments

collapse all

Rate of change of instruments prices with respect to changes in the interest rate, returned as a NINST-by-1 vector of deltas. Delta is computed by finite differences in calls to bktree.

Note

Delta is calculated based on yield shifts of 100 basis points.

Rate of change of instruments deltas with respect to changes in the interest rate, returned as a NINST-by-1 vector of gammas. Gamma is computed by finite differences in calls to bktree.

Note

Gamma is calculated based on yield shifts of 100 basis points.

Rate of change of instruments prices with respect to changes in the volatility, returned as a NINST-by-1 vector of vegas. Volatility is σ(t,T) of the interest rate. Vega is computed by finite differences in calls to bktree. For information on the volatility process, see bkvolspec.

Note

Vega is calculated based on 1% shift in the volatility process.

Price of each instrument, returned as a NINST-by-1 vector. The prices are computed by backward dynamic programming on the interest-rate tree. If an instrument cannot be priced, a NaN is returned in that entry.

Introduced before R2006a