Main Content

Computing Equity Instrument Sensitivities

Sensitivities can be reported either as dollar price changes or percentage price changes. The delta, gamma, and vega sensitivities that the toolbox computes are dollar sensitivities.

The functions crrsens, eqpsens, ittsens, and sttsens compute the delta, gamma, and vega sensitivities of instruments using a stock tree. They also optionally return the calculated price for each instrument. The sensitivity functions require the same two input arguments used by the pricing functions (CRRTree and CRRInstSet for CRR, EQPTree and EQPInstSet for EQP, ITTTree and ITTInstSet for ITT, and STTTree and STTInstSet for STT).

As with the instrument pricing functions, the optional input argument Options is also allowed. You would include this argument if you want a sensitivity function to generate a price for a barrier option as one of its outputs and want to control the method that the toolbox uses to perform the pricing operation. See Pricing Options Structure or the derivset function for more information.

For path-dependent options (lookback and Asian), delta and gamma are computed by finite differences in calls to crrprice, eqpprice, ittprice, and sttprice. For the other options (stock option, barrier, and compound), delta and gamma are computed from the CRR, EQP, ITT, and STT trees and the corresponding option price tree. (See Chriss, Neil, Black-Scholes and Beyond, pp. 308–312.)

Computing CRR Sensitivities

This example shows how to calculate the sensitivity of each instrument in the instrument set using crrsens.

Load the data into the MATLAB® workspace.

load deriv.mat

Use the MATLAB® whos command to display a list of the variables loaded from the MAT-file.

whos
  Name              Size            Bytes  Class     Attributes

  BDTInstSet        1x1             28737  struct              
  BDTTree           1x1              6289  struct              
  BKInstSet         1x1             28727  struct              
  BKTree            1x1              7355  struct              
  CIRInstSet        1x1             31123  struct              
  CIRTree           1x1              6784  struct              
  CRRInstSet        1x1             22035  struct              
  CRRTree           1x1              5832  struct              
  EQPInstSet        1x1             22035  struct              
  EQPTree           1x1              5832  struct              
  HJMInstSet        1x1             28729  struct              
  HJMTree           1x1              7206  struct              
  HWInstSet         1x1             28727  struct              
  HWTree            1x1              7355  struct              
  ITTInstSet        1x1             22039  struct              
  ITTTree           1x1             11367  struct              
  STTInstSet        1x1             22039  struct              
  STTTree           1x1              6600  struct              
  ZeroInstSet       1x1             18203  struct              
  ZeroRateSpec      1x1              1732  struct              

CRRTree and CRRInstSet are the input arguments required to call the function crrsens.

Use the command instdisp to examine the set of instruments contained in the variable CRRInstSet.

instdisp(CRRInstSet)
Index Type     OptSpec Strike Settle         ExerciseDates  AmericanOpt Name  Quantity
1     OptStock call    105    01-Jan-2003    01-Jan-2005    1           Call1 10      
2     OptStock put     105    01-Jan-2003    01-Jan-2006    0           Put1   5      
 
Index Type    OptSpec Strike Settle         ExerciseDates  AmericanOpt BarrierSpec Barrier Rebate Name     Quantity
3     Barrier call    105    01-Jan-2003    01-Jan-2006    1           ui          102     0      Barrier1 1       
 
Index Type     UOptSpec UStrike USettle        UExerciseDates UAmericanOpt COptSpec CStrike CSettle        CExerciseDates CAmericanOpt Name      Quantity
4     Compound call     130     01-Jan-2003    01-Jan-2006    1            put      5       01-Jan-2003    01-Jan-2005    1            Compound1 3       
 
Index Type     OptSpec Strike Settle         ExerciseDates  AmericanOpt Name      Quantity
5     Lookback call    115    01-Jan-2003    01-Jan-2006    0           Lookback1 7       
6     Lookback call    115    01-Jan-2003    01-Jan-2007    0           Lookback2 9       
 
Index Type  OptSpec Strike Settle         ExerciseDates  AmericanOpt AvgType    AvgPrice AvgDate Name   Quantity
7     Asian put     110    01-Jan-2003    01-Jan-2006    0           arithmetic NaN      NaN     Asian1 4       
8     Asian put     110    01-Jan-2003    01-Jan-2007    0           arithmetic NaN      NaN     Asian2 6       
 

The instrument set contains eight instruments:

  • Two vanilla options (Call1, Put1)

  • One barrier option (Barrier1)

  • One compound option (Compound1)

  • Two lookback options (Lookback1, Lookback2)

  • Two Asian options (Asian1, Asian2)

Use crrsens to calculate the sensitivity of each instrument in the instrument set.

[Delta, Gamma, Vega, Price] = crrsens(CRRTree, CRRInstSet)
Delta = 8×1

    0.5949
   -0.3115
    0.6885
   -0.1203
   -0.3991
   -0.4200
    0.6049
    0.8187

Gamma = 8×1
105 ×

    0.0000
    0.0000
    0.0000
   -0.0000
   -0.4593
   -1.1214
    0.4593
    1.1214

Vega = 8×1

   53.4471
   67.0043
   67.0043
  -98.0793
   88.1769
  119.1890
   49.2128
   41.7070

Price = 8×1

    8.2863
    2.5016
   12.1272
    3.3241
    7.6015
   11.7772
    4.1797
    3.4219

You can conveniently examine the sensitivities and the prices by arranging them into a single matrix.

format bank
All = [Delta, Gamma, Vega, Price]
All = 8×4

          0.59          0.04         53.45          8.29
         -0.31          0.03         67.00          2.50
          0.69          0.03         67.00         12.13
         -0.12         -0.01        -98.08          3.32
         -0.40     -45926.32         88.18          7.60
         -0.42    -112143.15        119.19         11.78
          0.60      45926.32         49.21          4.18
          0.82     112143.15         41.71          3.42

As with the prices, each row of the sensitivity vectors corresponds to the similarly indexed instrument in CRRInstSet. To view the per-dollar sensitivities, divide each dollar sensitivity by the corresponding instrument price.

All = [Delta ./ Price, Gamma ./ Price, Vega ./ Price, Price]
All = 8×4

          0.07          0.00          6.45          8.29
         -0.12          0.01         26.78          2.50
          0.06          0.00          5.53         12.13
         -0.04         -0.00        -29.51          3.32
         -0.05      -6041.77         11.60          7.60
         -0.04      -9522.02         10.12         11.78
          0.14      10987.98         11.77          4.18
          0.24      32771.92         12.19          3.42

ITT Sensitivities Example

The calling syntax for the sensitivity function is:

[Delta, Gamma, Vega, Price] = ittsens(ITTTree, ITTInstSet, Options)

Using the example data in deriv.mat, calculate the sensitivity of the instruments.

load deriv.mat
warning('off', 'fininst:itttree:Extrapolation');
[Delta, Gamma, Vega, Price] = ittsens(ITTTree, ITTInstSet);

You can conveniently examine the sensitivities and the prices by arranging them into a single matrix.

format bank
All = [Delta, Gamma, Vega, Price]
All =

          0.24          0.03         19.35          1.65
         -0.43          0.02         49.69         10.68
          0.35          0.04         12.29          2.41
         -0.07          0.00          6.73          3.23
          0.63     142945.66         38.90          0.54
          0.60      22703.21         68.92          6.18
          0.32    -142945.66         18.48          3.21
          0.67     -22703.21         17.75          6.61

As with the prices, each row of the sensitivity vectors corresponds to the similarly indexed instrument in ITTInstSet.

Note

In this example, the extrapolation warnings are turned off before calculating the sensitivities to avoid displaying many warnings on the Command Window as the sensitivities are calculated.

If the extrapolation warnings are turned on

warning('on', 'fininst:itttree:Extrapolation');
and ittsens is rerun, the extrapolation warnings scroll as the command executes:
[Delta, Gamma, Vega, Price] = ittsens(ITTTree, ITTInstSet)
Warning: The option set specified in StockOptSpec was too narrow for the
generated tree.
This made extrapolation necessary. Below is a list of the options that were
outside of the
range of those specified in StockOptSpec.

Option Type: 'call'   Maturity: 01-Jan-2007  Strike=67.2897
Option Type: 'put'   Maturity: 01-Jan-2007  Strike=37.1528
Option Type: 'put'   Maturity: 01-Jan-2008  Strike=27.6066
Option Type: 'put'   Maturity: 31-Dec-2008  Strike=20.5132
Option Type: 'call'   Maturity: 01-Jan-2010  Strike=164.0157
Option Type: 'put'   Maturity: 01-Jan-2010  Strike=15.2424
 
> In itttree>InterpOptPrices (line 680)
  In itttree (line 285)
  In stocktreesens>stocktreevega (line 193)
  In stocktreesens (line 94)
  In ittsens (line 79) 

Delta =

          0.24
         -0.43
          0.35
         -0.07
          0.63
          0.60
          0.32
          0.67


Gamma =

          0.03
          0.02
          0.04
          0.00
     142945.66
      22703.21
    -142945.66
     -22703.21


Vega =

         19.35
         49.69
         12.29
          6.73
         38.90
         68.92
         18.48
         17.75


Price =

          1.65
         10.68
          2.41
          3.23
          0.54
          6.18
          3.21
          6.61

These warnings are a consequence of having to extrapolate to find the option price of the tree nodes. In this example, the set of inputs options was too narrow for the shift in the tree nodes introduced by the disturbance used to calculate the sensitivities. As a consequence extrapolation for some of the nodes was needed. Since the input data is quite close the extrapolated data, the error introduced by extrapolation is fairly low.

Computing STT Sensitivities

This example shows how to calculate the sensitivity of each instrument in the instrument set using sttsens.

Load the data into the MATLAB® workspace.

load deriv.mat

Use the MATLAB® whos command to display a list of the variables loaded from the MAT-file.

whos
  Name              Size            Bytes  Class     Attributes

  BDTInstSet        1x1             28737  struct              
  BDTTree           1x1              6289  struct              
  BKInstSet         1x1             28727  struct              
  BKTree            1x1              7355  struct              
  CIRInstSet        1x1             31123  struct              
  CIRTree           1x1              6784  struct              
  CRRInstSet        1x1             22035  struct              
  CRRTree           1x1              5832  struct              
  EQPInstSet        1x1             22035  struct              
  EQPTree           1x1              5832  struct              
  HJMInstSet        1x1             28729  struct              
  HJMTree           1x1              7206  struct              
  HWInstSet         1x1             28727  struct              
  HWTree            1x1              7355  struct              
  ITTInstSet        1x1             22039  struct              
  ITTTree           1x1             11367  struct              
  STTInstSet        1x1             22039  struct              
  STTTree           1x1              6600  struct              
  ZeroInstSet       1x1             18203  struct              
  ZeroRateSpec      1x1              1732  struct              

ITTTree and ITTInstSet are the input arguments required to call the function sttsens.

Use the command instdisp to examine the set of instruments contained in the variable STTInstSet.

instdisp(STTInstSet)
Index Type     OptSpec Strike Settle         ExerciseDates  AmericanOpt Name  Quantity
1     OptStock call    100    01-Jan-2009    01-Jan-2011    1           Call1 10      
2     OptStock put      80    01-Jan-2009    01-Jan-2012    0           Put1   5      
 
Index Type    OptSpec Strike Settle         ExerciseDates  AmericanOpt BarrierSpec Barrier Rebate Name     Quantity
3     Barrier call    105    01-Jan-2009    01-Jan-2012    1           ui          115     0      Barrier1 1       
 
Index Type     UOptSpec UStrike USettle        UExerciseDates UAmericanOpt COptSpec CStrike CSettle        CExerciseDates CAmericanOpt Name      Quantity
4     Compound call     95      01-Jan-2009    01-Jan-2012    1            put      5       01-Jan-2009    01-Jan-2011    1            Compound1 3       
 
Index Type     OptSpec Strike Settle         ExerciseDates  AmericanOpt Name      Quantity
5     Lookback call    90     01-Jan-2009    01-Jan-2012    0           Lookback1 7       
6     Lookback call    95     01-Jan-2009    01-Jan-2013    0           Lookback2 9       
 
Index Type  OptSpec Strike Settle         ExerciseDates  AmericanOpt AvgType    AvgPrice AvgDate Name   Quantity
7     Asian call    100    01-Jan-2009    01-Jan-2012    0           arithmetic NaN      NaN     Asian1 4       
8     Asian call    100    01-Jan-2009    01-Jan-2013    0           arithmetic NaN      NaN     Asian2 6       
 

The instrument set contains eight instruments:

  • Two vanilla options (Call1, Put1)

  • One barrier option (Barrier1)

  • One compound option (Compound1)

  • Two lookback options (Lookback1, Lookback2)

  • Two Asian options (Asian1, Asian2)

Use ittsens to calculate the sensitivity of each instrument in the instrument set.

[Delta, Gamma, Vega, Price] = sttsens(STTTree, STTInstSet)
Delta = 8×1

    0.5267
   -0.0943
    0.4726
   -0.0624
    0.2313
    0.3266
    0.5706
    0.6646

Gamma = 8×1
105 ×

    0.0000
    0.0000
    0.0000
    0.0000
   -1.8650
   -1.9119
    1.8650
    1.9119

Vega = 8×1

   52.8980
   42.4369
   25.9792
   -9.5266
   70.3758
   92.9226
   25.8122
   37.8757

Price = 8×1

    4.5025
    3.0603
    3.7977
    1.7090
   11.7296
   12.9120
    1.6905
    2.6203

You can conveniently examine the sensitivities and the prices by arranging them into a single matrix.

format bank
All = [Delta, Gamma, Vega, Price]
All = 8×4

          0.53          0.02         52.90          4.50
         -0.09          0.00         42.44          3.06
          0.47          0.03         25.98          3.80
         -0.06          0.00         -9.53          1.71
          0.23    -186495.25         70.38         11.73
          0.33    -191186.43         92.92         12.91
          0.57     186495.25         25.81          1.69
          0.66     191186.43         37.88          2.62

As with the prices, each row of the sensitivity vectors corresponds to the similarly indexed instrument in ITTInstSet. To view the per-dollar sensitivities, divide each dollar sensitivity by the corresponding instrument price.

All = [Delta ./ Price, Gamma ./ Price, Vega ./ Price, Price]
All = 8×4

          0.12          0.01         11.75          4.50
         -0.03          0.00         13.87          3.06
          0.12          0.01          6.84          3.80
         -0.04          0.00         -5.57          1.71
          0.02     -15899.56          6.00         11.73
          0.03     -14806.91          7.20         12.91
          0.34     110321.92         15.27          1.69
          0.25      72962.88         14.45          2.62

Computing EQP Sensitivities

This example shows how to calculate the sensitivity of each instrument in the instrument set using eqpsens.

Load the data into the MATLAB® workspace.

load deriv.mat

Use the MATLAB® whos command to display a list of the variables loaded from the MAT-file.

whos
  Name              Size            Bytes  Class     Attributes

  BDTInstSet        1x1             28737  struct              
  BDTTree           1x1              6289  struct              
  BKInstSet         1x1             28727  struct              
  BKTree            1x1              7355  struct              
  CIRInstSet        1x1             31123  struct              
  CIRTree           1x1              6784  struct              
  CRRInstSet        1x1             22035  struct              
  CRRTree           1x1              5832  struct              
  EQPInstSet        1x1             22035  struct              
  EQPTree           1x1              5832  struct              
  HJMInstSet        1x1             28729  struct              
  HJMTree           1x1              7206  struct              
  HWInstSet         1x1             28727  struct              
  HWTree            1x1              7355  struct              
  ITTInstSet        1x1             22039  struct              
  ITTTree           1x1             11367  struct              
  STTInstSet        1x1             22039  struct              
  STTTree           1x1              6600  struct              
  ZeroInstSet       1x1             18203  struct              
  ZeroRateSpec      1x1              1732  struct              

EQPTree and EQPInstSet are the input arguments required to call the function eqpsens.

Use the command instdisp to examine the set of instruments contained in the variable EQPInstSet.

instdisp(EQPInstSet)
Index Type     OptSpec Strike Settle         ExerciseDates  AmericanOpt Name  Quantity
1     OptStock call    105    01-Jan-2003    01-Jan-2005    1           Call1 10      
2     OptStock put     105    01-Jan-2003    01-Jan-2006    0           Put1   5      
 
Index Type    OptSpec Strike Settle         ExerciseDates  AmericanOpt BarrierSpec Barrier Rebate Name     Quantity
3     Barrier call    105    01-Jan-2003    01-Jan-2006    1           ui          102     0      Barrier1 1       
 
Index Type     UOptSpec UStrike USettle        UExerciseDates UAmericanOpt COptSpec CStrike CSettle        CExerciseDates CAmericanOpt Name      Quantity
4     Compound call     130     01-Jan-2003    01-Jan-2006    1            put      5       01-Jan-2003    01-Jan-2005    1            Compound1 3       
 
Index Type     OptSpec Strike Settle         ExerciseDates  AmericanOpt Name      Quantity
5     Lookback call    115    01-Jan-2003    01-Jan-2006    0           Lookback1 7       
6     Lookback call    115    01-Jan-2003    01-Jan-2007    0           Lookback2 9       
 
Index Type  OptSpec Strike Settle         ExerciseDates  AmericanOpt AvgType    AvgPrice AvgDate Name   Quantity
7     Asian put     110    01-Jan-2003    01-Jan-2006    0           arithmetic NaN      NaN     Asian1 4       
8     Asian put     110    01-Jan-2003    01-Jan-2007    0           arithmetic NaN      NaN     Asian2 6       
 

The instrument set contains eight instruments:

  • Two vanilla options (Call1, Put1)

  • One barrier option (Barrier1)

  • One compound option (Compound1)

  • Two lookback options (Lookback1, Lookback2)

  • Two Asian options (Asian1, Asian2)

Use eqpsens to calculate the sensitivity of each instrument in the instrument set.

[Delta, Gamma, Vega, Price] = eqpsens(EQPTree, EQPInstSet)
Delta = 8×1

    0.6501
   -0.2336
    0.7664
   -0.1251
   -0.5443
   -0.4516
    0.7066
    0.8357

Gamma = 8×1
105 ×

    0.0000
    0.0000
    0.0000
   -0.0000
   -0.5435
   -1.2133
    0.5435
    1.2133

Vega = 8×1

   44.2790
   73.3662
   73.3662
         0
  101.1634
  109.5524
   36.7642
   42.3509

Price = 8×1

    8.4791
    2.6375
   12.2632
    3.5091
    8.7941
   12.9577
    4.7444
    3.9178

You can conveniently examine the sensitivities and the prices by arranging them into a single matrix.

format bank
All = [Delta, Gamma, Vega, Price]
All = 8×4

          0.65          0.04         44.28          8.48
         -0.23          0.02         73.37          2.64
          0.77          0.02         73.37         12.26
         -0.13         -0.01             0          3.51
         -0.54     -54353.69        101.16          8.79
         -0.45    -121330.73        109.55         12.96
          0.71      54353.69         36.76          4.74
          0.84     121330.73         42.35          3.92

As with the prices, each row of the sensitivity vectors corresponds to the similarly indexed instrument in EQPInstSet. To view the per-dollar sensitivities, divide each dollar sensitivity by the corresponding instrument price.

All = [Delta ./ Price, Gamma ./ Price, Vega ./ Price, Price]
All = 8×4

          0.08          0.00          5.22          8.48
         -0.09          0.01         27.82          2.64
          0.06          0.00          5.98         12.26
         -0.04         -0.00             0          3.51
         -0.06      -6180.71         11.50          8.79
         -0.03      -9363.61          8.45         12.96
          0.15      11456.35          7.75          4.74
          0.21      30968.71         10.81          3.92

See Also

| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

Topics