intenvsens
Instrument price and sensitivities from set of zero curves
Description
[
computes dollar prices and price sensitivities for instruments that use a zero coupon bond
rate structure. Delta
,Gamma
,Price
] = intenvprice(RateSpec
InstSet
)
intenvsens
handles the following instrument types:
'Bond'
, 'CashFlow'
, 'Fixed'
,
'Float'
, 'Swap'
. See instadd
for information about constructing defined types.
Examples
Compute Prices Sensitivities for Instruments Using a Zero Coupon Bond Rate Structure
Load the tree and instruments from the deriv.mat
data file and use intenvprice
to compute dollar prices and sensitivities for instruments that use a zero coupon bond rate structure.
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 = 5×1
-272.6403
-347.4386
-272.6403
-1.0445
-282.0405
Gamma = 5×1
103 ×
1.0298
1.6227
1.0298
0.0033
1.0596
Input Arguments
RateSpec
— Interest-rate specification
structure
(Optional) Interest-rate specification, specified by the RateSpec
obtained previously from intenvset
or toRateSpec
for an IRDataCurve
or toRateSpec
for an IRFunctionCurve
.
Data Types: struct
InstSet
— Instrument variable containing a collection of instruments
structure
Instrument variable containing a collection of 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
Output Arguments
Delta
— Rate of change of instrument prices with respect to shifts in the observed zero curve
vector
Rate of change of instrument prices with respect to shifts in the observed zero
curve, returned as a number of instruments (NINST
) by number of
curves (NUMCURVES
) matrix. Delta
is computed by
finite differences.
Note
Delta
sensitivities are returned as dollar sensitivities. To
find the per-dollar sensitivities, divide by the respective instrument price.
Gamma
— Rate of change of instrument deltas with respect to shifts in the observed zero curve
vector
Rate of change of instrument deltas with respect to shifts in the observed zero
curve, returned as a number of instruments (NINST
) by number of
curves (NUMCURVES
) matrix. Gamma
is computed by
finite differences.
Note
Gamma
sensitivities are returned as dollar sensitivities. To
find the per-dollar sensitivities, divide by the respective instrument price.
Price
— Prices of each instrument
vector
Prices of each instrument, returned as a number of instruments
(NINST
) by number of curves (NUMCURVES
) matrix.
If an instrument cannot be priced, a NaN
is returned in that
entry.
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)