hwsens

Instrument prices and sensitivities from Hull-White interest-rate tree

Description

example

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

hwsens 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] = hwsens(___,Options) adds an optional input argument for Options.

Examples

collapse all

Load the tree and instruments from the deriv.mat data file. Compute Delta and Gamma for the cap and bond instruments contained in the instrument set.

HWSubSet = instselect(HWInstSet,'Type', {'Bond', 'Cap'});

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

Index Type Strike Settle         Maturity       CapReset Basis Principal Name   Quantity
3     Cap  0.06   01-Jan-2004    01-Jan-2008    1        0     100       6% Cap 10

Compute the Delta and Gamma for the cap and bond instruments.

[Delta, Gamma] = hwsens(HWTree, HWSubSet)
Delta = 3×1

-291.2580
-374.6368
60.9580

Gamma = 3×1
103 ×

0.8584
1.4609
5.5994

Input Arguments

collapse all

Interest-rate tree structure, specified by using hwtree.

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 hwtree.

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 hwtree.

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 $\sigma \left(t,T\right)$ of the interest rate. Vega is computed by finite differences in calls to hwtree. For information on the volatility process, see hwvolspec.

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