Main Content

sttsens

Instrument sensitivities and prices using standard trinomial tree

Description

[Delta,Gamma,Vega,Price] = sttsens(STTTree,InstSet) to generate instrument sensitivities and prices using a standard trinomial (STT) tree.

example

[Delta,Gamma,Vega,Price] = sttsens(___,Name,Value) to generate instrument sensitivities and prices using a standard trinomial (STT) tree with an optional name-value pair argument for Options.

example

Examples

collapse all

Load the data into the MATLAB® workspace.

load deriv.mat

STTTree and STTInstSet are the input arguments required to call the function sttprice. 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 sttsens to calculate the price and sensitivities for 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

Create a RateSpec.

StartDates = datetime(2015,1,1); 
EndDates = datetime(2020,1,1); 
Rates = 0.025; 
Basis = 1; 

RateSpec = intenvset('ValuationDate',StartDates,'StartDates',StartDates,...
'EndDates',EndDates,'Rates',Rates,'Compounding',-1,'Basis',Basis)
RateSpec = struct with fields:
           FinObj: 'RateSpec'
      Compounding: -1
             Disc: 0.8825
            Rates: 0.0250
         EndTimes: 5
       StartTimes: 0
         EndDates: 737791
       StartDates: 735965
    ValuationDate: 735965
            Basis: 1
     EndMonthRule: 1

Create a StockSpec.

AssetPrice = 80; 
Sigma = 0.12; 
StockSpec = stockspec(Sigma,AssetPrice)
StockSpec = struct with fields:
             FinObj: 'StockSpec'
              Sigma: 0.1200
         AssetPrice: 80
       DividendType: []
    DividendAmounts: 0
    ExDividendDates: []

Create a STTTree.

TimeSpec = stttimespec(StartDates, EndDates, 20);
STTTree = stttree(StockSpec, RateSpec, TimeSpec)
STTTree = struct with fields:
       FinObj: 'STStockTree'
    StockSpec: [1x1 struct]
     TimeSpec: [1x1 struct]
     RateSpec: [1x1 struct]
         tObs: [0 0.2500 0.5000 0.7500 1 1.2500 1.5000 1.7500 2 2.2500 2.5000 2.7500 3 3.2500 3.5000 3.7500 4 4.2500 4.5000 4.7500 5]
         dObs: [735965 736056 736147 736238 736330 736421 736512 736604 736695 736786 736878 736969 737060 737151 737243 737334 737425 737517 737608 737699 737791]
        STree: {1x21 cell}
        Probs: {1x20 cell}

Define the convertible bond. The convertible bond can be called starting on Jan 1, 2016 with a strike price of 95.

CouponRate = 0.03;
Settle = datetime(2015,1,1); 
Maturity = datetime(2018,4,1); 
Period = 1;
CallStrike = 95; 
CallExDates = [datetime(2016,1,1) datetime(2018,4,1)];
ConvRatio = 1;
Spread = 0.025;

Price the convertible bond using the standard trinomial tree model.

[Price,PriceTree,EqtTre,DbtTree] = cbondbystt(STTTree,CouponRate,Settle,Maturity,ConvRatio,...
'Period',Period,'Spread',Spread,'CallExDates',CallExDates,'CallStrike',CallStrike,'AmericanCall', 1)
Price = 
90.2511
PriceTree = struct with fields:
    FinObj: 'TrinPriceTree'
     PTree: {1x21 cell}
      tObs: [0 0.2500 0.5000 0.7500 1 1.2500 1.5000 1.7500 2 2.2500 2.5000 2.7500 3 3.2500 3.5000 3.7500 4 4.2500 4.5000 4.7500 5]
      dObs: [735965 736056 736147 736238 736330 736421 736512 736604 736695 736786 736878 736969 737060 737151 737243 737334 737425 737517 737608 737699 737791]

EqtTre = struct with fields:
    FinObj: 'TrinPriceTree'
     PTree: {1x21 cell}
      tObs: [0 0.2500 0.5000 0.7500 1 1.2500 1.5000 1.7500 2 2.2500 2.5000 2.7500 3 3.2500 3.5000 3.7500 4 4.2500 4.5000 4.7500 5]
      dObs: [735965 736056 736147 736238 736330 736421 736512 736604 736695 736786 736878 736969 737060 737151 737243 737334 737425 737517 737608 737699 737791]

DbtTree = struct with fields:
    FinObj: 'TrinPriceTree'
     PTree: {1x21 cell}
      tObs: [0 0.2500 0.5000 0.7500 1 1.2500 1.5000 1.7500 2 2.2500 2.5000 2.7500 3 3.2500 3.5000 3.7500 4 4.2500 4.5000 4.7500 5]
      dObs: [735965 736056 736147 736238 736330 736421 736512 736604 736695 736786 736878 736969 737060 737151 737243 737334 737425 737517 737608 737699 737791]

Compute the delta and gamma of the convertible bond.

InstSet= instcbond(CouponRate,Settle,Maturity,ConvRatio,'Spread',Spread,...
'CallExDates',CallExDates,'CallStrike',CallStrike,'AmericanCall',1);
[Delta,Gamma] = sttsens(STTTree,InstSet)
Delta = 
0.3945
Gamma = 
0.0324

Input Arguments

collapse all

Stock tree structure for a standard trinomial tree, specified by using stttree.

Data Types: struct

Variable containing a collection of NINST instruments, specified as a structure. Instruments are broken down by type and each type can have different data fields.

Data Types: struct

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: [Delta,Gamma,Vega,Price] = sttsens(STTTree,InstSet,'Options',deriv)

Derivatives pricing options, specified as the comma-separated pair consisting of 'Options' and a structure that is created with derivset.

Data Types: struct

Output Arguments

collapse all

Rate of change of instrument prices with respect to changes in the stock price, returned as a NINST-by-1 vector of deltas. For more information on the stock tree, see stttree.

Rate of change of instrument deltas with respect to changes in the stock price, returned as a NINST-by-1 vector of gammas.

Rate of change of instrument prices with respect to changes in the volatility of the stock price, returned as a NINST-by-1 vector of vegas. For more information on the stock tree, see stttree.

Expected prices for each instrument at time 0, returned as a NINST-by-1 vector. The prices are computed by backward dynamic programming on the standard trinomial (STT) stock tree. If an instrument cannot be priced, a NaN is returned in that entry.

Version History

Introduced in R2015b