Instrument price and sensitivities from set of zero curves
[Delta, Gamma, Price] = intenvsens(RateSpec,
A structure containing the properties of an interest-rate structure. See intenvset for information on creating RateSpec.
Variable containing a collection of 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.
Delta is a number of instruments (NINST) by number of curves (NUMCURVES) matrix of deltas, representing the rate of change of instrument prices with respect to shifts in the observed forward yield curve. Delta is computed by finite differences.
Gamma is an NINST-by-NUMCURVES matrix of gammas, representing the rate of change of instrument deltas with respect to shifts in the observed forward yield curve. Gamma is computed by finite differences.
Note Both sensitivities are returned as dollar sensitivities. To find the per-dollar sensitivities, divide by the respective instrument price.
Price is an NINST-by-NUMCURVES matrix of prices of each instrument. If an instrument cannot be priced, a NaN is returned.
intenvsens handles the following instrument types: 'Bond', 'CashFlow', 'Fixed', 'Float', 'Swap'. See instadd for information about constructing defined types.
Load the tree and instruments from a data file.
load deriv.mat instdisp(ZeroInstSet)
Index Type CouponRate Settle Maturity Period Basis EndMonthRule IssueDate FirstCouponDate LastCouponDate StartDate Face Name Quantity 1 Bond 0.04 01-Jan-2000 01-Jan-2003 1 NaN NaN NaN NaN NaN NaN NaN 4% bond 100 2 Bond 0.04 01-Jan-2000 01-Jan-2004 2 NaN NaN NaN NaN NaN NaN NaN 4% bond 50 Index Type CouponRate Settle Maturity FixedReset Basis Principal Name Quantity 3 Fixed 0.04 01-Jan-2000 01-Jan-2003 1 NaN NaN 4% Fixed 80 Index Type Spread Settle Maturity FloatReset Basis Principal Name Quantity 4 Float 20 01-Jan-2000 01-Jan-2003 1 NaN NaN 20BP Float 8 Index Type LegRate Settle Maturity LegReset Basis Principal LegType Name Quantity 5 Swap [0.06 20] 01-Jan-2000 01-Jan-2003 [1 1] NaN NaN [NaN] 6%/20BP Swap 10
[Delta, Gamma] = intenvsens(ZeroRateSpec, ZeroInstSet)
Delta = -272.6403 -347.4386 -272.6403 -1.0445 -282.0405 Gamma = 1.0e+003 * 1.0298 1.6227 1.0298 0.0033 1.0596