Products & Services Solutions Academia Support User Community Company

Learn more about Financial Derivatives Toolbox   

Understanding Equity Trees

Introduction

Financial Derivatives Toolbox software supports three types of recombining tree models to represent the evolution of stock prices:

For a discussion of recombining trees, see Rate and Price Trees.

The CRR, EQP, and ITT models are examples of discrete time models. A discrete time model divides time into discrete bits; prices can only be computed at these specific times.

The CRR model is one of the most common methods used to model the evolution of stock processes. The strength of the CRR model lies in its simplicity. It is a good model when dealing with many tree levels. The CRR model yields the correct expected value for each node of the tree and provides a good approximation for the corresponding local volatility. The approximation becomes better as the number of time steps represented in the tree is increased.

The EQP model is another discrete time model. It has the advantage of building a tree with the exact volatility in each tree node, even with small numbers of time steps. It also provides better results than CRR in some given trading environments, for example, when stock volatility is low and interest rates are high. However, this additional precision causes increased complexity, which is reflected in the number of calculations required to build a tree.

The ITT model is a CRR-style implied trinomial tree which takes advantage of prices quoted from liquid options in the market with varying strikes and maturities to build a tree that more accurately represents the market. An ITT model is commonly used to price exotic options in such a way that they are consistent with the market prices of standard options.

Building Equity Binary Trees

The tree of stock prices is the fundamental unit representing the evolution of the price of a stock over a given period of time. The MATLAB functions crrtree and eqptree create CRR trees and EQP trees respectively. These functions create an output tree structure along with information about the parameters used for creating the tree.

The functions crrtree and eqptree take three structures as input arguments:

Calling Sequence for Equity Binary Trees

The calling syntax for crrtree is:

CRRTree = crrtree (StockSpec, RateSpec, TimeSpec)

Similarly, the calling syntax for eqptree is:

EQPTree = eqptree (StockSpec, RateSpec, TimeSpec)

Both functions require the structures StockSpec, RateSpec, and TimeSpec as input arguments:

Specifying the Stock Structure for Equity Binary Trees

The structure StockSpec encapsulates the stock-specific information required for building the binary tree of an individual stock's price movement.

You generate StockSpec with the function stockspec. This function requires two input arguments and accepts up to three additional input arguments that depend on the existence and type of dividend payments.

The syntax for calling stockspec is:

StockSpec = stockspec(Sigma, AssetPrice, DividendType, ...
DividendAmounts, ExDividendDates)

where:

Stock Structure Example Using a Binary Tree

Consider a stock with a price of $100 and an annual volatility of 15%. Assume that the stock pays three cash $5.00 dividends on dates January 01, 2003; July 01, 2003; and January 01, 2004. You specify these parameters in MATLAB as:

Sigma = 0.15;
AssetPrice = 100;
DividendType = 'cash';
DividendAmounts = [5; 5; 5];
ExDividendDates = {'jan-01-2004', 'july-01-2005', 'jan-01-2006'};

StockSpec = stockspec(Sigma, AssetPrice, DividendType, ... 
DividendAmounts, ExDividendDates)

StockSpec = 

               FinObj: 'StockSpec'
                Sigma: 0.1500
           AssetPrice: 100
         DividendType: 'cash'
      DividendAmounts: [3x1 double]
      ExDividendDates: [3x1 double]

Specifying the Interest-Rate Term Structure for Equity Binary Trees

The RateSpec structure defines the interest rate environment used when building the stock price binary tree. Functions That Model the Interest-Rate Term Structure explains how to create these structures using the function intenvset, given the interest rates, the starting and ending dates for each rate, and the compounding value.

Specifying the Tree-Time Term Structure for Equity Binary Trees

The TimeSpec structure defines the tree layout of the binary tree:

The syntax for building a TimeSpec structure is:

TimeSpec = crrtimespec(ValuationDate, Maturity, NumPeriods)
TimeSpec = eqptimespec(ValuationDate, Maturity, NumPeriods)

where:

TimeSpec Example Using a Binary Tree

Consider building a CRR tree, with a valuation date of January 1, 2003, a maturity date of January 1, 2008, and 20 time steps. You specify these parameters in MATLAB as:

ValuationDate = 'Jan-1-2003';
Maturity = 'Jan-1-2008';
NumPeriods = 20;
TimeSpec = crrtimespec(ValuationDate, Maturity, NumPeriods)
TimeSpec = 

           FinObj: 'BinTimeSpec'
    ValuationDate: 731582
         Maturity: 733408
       NumPeriods: 20
            Basis: 0
     EndMonthRule: 1
             tObs: [1x21 double]
             dObs: [1x21 double]

Two vector fields in the TimeSpec structure are of particular interest: dObs and tObs. These two fields represent the observation times and corresponding dates of all tree levels, with dObs(1) and tObs(1), respectively, representing the root node (ValuationDate), and dObs(end) and tObs(end) representing the last tree level (Maturity).

Examples of Binary Tree Creation

You can now use the StockSpec and TimeSpec structures described previously to build an equal probability tree (EQPTree) and a CRR tree (CRRTree). First, you must define the interest rate term structure. For this example, assume that the interest rate is fixed at 10% annually between the valuation date of the tree (January 1, 2003) until its maturity.

ValuationDate = 'Jan-1-2003';
Maturity = 'Jan-1-2008';
Rate = 0.1;
RateSpec = intenvset('Rates', Rate, 'StartDates', ... 
ValuationDate, 'EndDates', Maturity, 'Compounding', -1);

To build a CRRTree, enter:

CRRTree = crrtree(StockSpec, RateSpec, TimeSpec)

CRRTree = 

       FinObj: 'BinStockTree'
       Method: 'CRR'
    StockSpec: [1x1 struct]
     TimeSpec: [1x1 struct]
     RateSpec: [1x1 struct]
         tObs: [1x21 double]
         dObs: [1x21 double]
        STree: {1x21 cell}
      UpProbs: [1x20 double]

To build an EQPTree, enter:

EQPTree = eqptree(StockSpec, RateSpec, TimeSpec)

EQPTree = 

       FinObj: 'BinStockTree'
       Method: 'EQP'
    StockSpec: [1x1 struct]
     TimeSpec: [1x1 struct]
     RateSpec: [1x1 struct]
         tObs: [1x21 double]
         dObs: [1x21 double]
        STree: {1x21 cell}
      UpProbs: [1x20 double]

Building Implied Trinomial Trees

The tree of stock prices is the fundamental unit representing the evolution of the price of a stock over a given period of time. The MATLAB function itttree creates an output tree structure along with the information about the parameters used to create the tree.

The function itttree takes four structures as input arguments:

Calling Sequence for Implied Trinomial Trees

The calling syntax for itttree is:

ITTTree = itttree (StockSpec,RateSpec,TimeSpec,StockOptSpec)

Specifying the Stock Structure for Implied Trinomial Trees

The structure StockSpec encapsulates the stock-specific information required for building the trinomial tree of an individual stock's price movement.

You generate StockSpec with the function stockspec. This function requires two input arguments and accepts up to three additional input arguments that depend on the existence and type of dividend payments.

The syntax for calling stockspec is:

StockSpec = stockspec(Sigma, AssetPrice, DividendType, ...
DividendAmounts, ExDividendDates)

where:

Stock Structure Example Using an Implied Trinomial Tree

Consider a stock with a price of $100 and an annual volatility of 12%. Assume that the stock is expected to pay a dividend yield of 6%. You specify these parameters in MATLAB as:

So=100;
DividendYield = 0.06; 
Sigma=.12;

StockSpec = stockspec(Sigma, So, 'continuous', DividendYield)

StockSpec = 

             FinObj: 'StockSpec'
              Sigma: 0.1200
         AssetPrice: 100
       DividendType: 'continuous'
    DividendAmounts: 0.0600
    ExDividendDates: []

Specifying the Interest-Rate Term Structure for Implied Trinomial Trees

The structure RateSpec defines the interest rate environment used when building the stock price binary tree. Functions That Model the Interest-Rate Term Structure explains how to create these structures using the function intenvset, given the interest rates, the starting and ending dates for each rate, and the compounding value.

Specifying the Tree-Time Term Structure for Implied Trinomial Trees

The TimeSpec structure defines the tree layout of the trinomial tree:

The syntax for building a TimeSpec structure is:

TimeSpec = itttimespec(ValuationDate, Maturity, NumPeriods)

where:

TimeSpec Example Using an Implied Trinomial Tree

Consider building an ITT tree, with a valuation date of January 1, 2006, a maturity date of January 1, 2008, and four time steps. You specify these parameters in MATLAB as:

ValuationDate = '01-01-2006';
EndDate = '01-01-2008';
NumPeriods = 4;
 
TimeSpec = itttimespec(ValuationDate, EndDate, NumPeriods)

TimeSpec = 

           FinObj: 'ITTTimeSpec'
    ValuationDate: 732678
         Maturity: 733408
       NumPeriods: 4
            Basis: 0
     EndMonthRule: 1
             tObs: [0 0.5000 1 1.5000 2]
             dObs: [732678 732860 733043 733225 733408]

Two vector fields in the TimeSpec structure are of particular interest: dObs and tObs. These two fields represent the observation times and corresponding dates of all tree levels, with dObs(1) and tObs(1), respectively, representing the root node (ValuationDate), and dObs(end) and tObs(end) representing the last tree level (Maturity).

Specifying the Option Stock Structure for Implied Trinomial Trees

The StockOptSpec structure encapsulates the option-stock-specific information required for building the implied trinomial tree. You generate StockOptSpec with the function stockoptspec. This function requires five input arguments. An optional sixth argument InterpMethod, specifying the interpolation method, can be included. The syntax for calling stockoptspec is:

[StockOptSpec] = stockoptspec(OptPrice, Strike, Settle, Maturity, OptSpec)

where:

Option Stock Structure Example Using an Implied Trinomial Tree

Consider the following data quoted from liquid options in the market with varying strikes and maturity. You specify these parameters in MATLAB as:

Settle =   '01/01/06';

Maturity =    ['07/01/06';
    '07/01/06';
    '07/01/06';
    '07/01/06';
    '01/01/07';
    '01/01/07';
    '01/01/07';
    '01/01/07';
    '07/01/07';
    '07/01/07';
    '07/01/07';
    '07/01/07';
    '01/01/08';
    '01/01/08';
    '01/01/08';
    '01/01/08'];

Strike = [113;
   101;
   100;
    88;
   128;
   112;
   100;
    78;
   144;
   112;
   100;
    69;
   162;
   112;
   100;
    61];

OptPrice =[                 0;
   4.807905472659144;
   1.306321897011867;
   0.048039195057173;
                   0;
   2.310953054191461;
   1.421950392866235;
   0.020414826276740;
                   0;
   5.091986935627730;
   1.346534812295291;
   0.005101325584140;
                   0;
   8.047628153217246;
   1.219653432150932;
   0.001041436654748];


OptSpec = { 'call';
    'call';
    'put';
    'put';
    'call';
    'call';
    'put';
    'put';
    'call';
    'call';
    'put';
    'put';
    'call';
    'call';
    'put';
    'put'};
    
StockOptSpec = stockoptspec(OptPrice, Strike, Settle, Maturity, OptSpec)

StockOptSpec = 

          FinObj: 'StockOptSpec'
        OptPrice: [16x1 double]
          Strike: [16x1 double]
          Settle: 732678
        Maturity: [16x1 double]
         OptSpec: {16x1 cell}
    InterpMethod: 'price'

Creating an Implied Trinomial Tree

You can now use the StockSpec, TimeSpec, and StockOptSpec structures described in Stock Structure Example Using an Implied Trinomial Tree, TimeSpec Example Using an Implied Trinomial Tree, and Option Stock Structure Example Using an Implied Trinomial Tree to build an implied trinomial tree (ITT). First, you must define the interest rate term structure. For this example, assume that the interest rate is fixed at 8% annually between the valuation date of the tree (January 1, 2006) until its maturity.

Rate = 0.08;
ValuationDate = '01-01-2006';
EndDate = '01-01-2008';

RateSpec = intenvset('StartDates', ValuationDate, 'EndDates', EndDate, ...
    'ValuationDate', ValuationDate, 'Rates', Rate, 'Compounding', -1);

To build an ITTTree, enter:

ITTTree = itttree(StockSpec, RateSpec, TimeSpec, StockOptSpec)

ITTTree = 

          FinObj: 'ITStockTree'
       StockSpec: [1x1 struct]
    StockOptSpec: [1x1 struct]
        TimeSpec: [1x1 struct]
        RateSpec: [1x1 struct]
            tObs: [0 0.500000000000000 1 1.500000000000000 2]
            dObs: [732678 732860 733043 733225 733408]
           STree: {1x5 cell}
           Probs: {[3x1 double]  [3x3 double]  [3x5 double]  [3x7 double]}

Examining Equity Trees

Financial Derivatives Toolbox software uses equity binary and implied trinomial trees to represent prices of equity options and of underlying stocks. At the highest level, these trees have structures wrapped around them. The structures encapsulate information required to interpret information in the tree.

To examine an equity binary or trinomial tree, load the data in the MAT-file deriv.mat into the MATLAB workspace.

load deriv.mat

Display the list of variables loaded from the MAT-file with the whos command.

  Name              Size            Bytes  Class     Attributes

  BDTInstSet        1x1             15956  struct              
  BDTTree           1x1              5138  struct              
  BKInstSet         1x1             15946  struct              
  BKTree            1x1              5904  struct              
  CRRInstSet        1x1             12434  struct              
  CRRTree           1x1              5058  struct              
  EQPInstSet        1x1             12434  struct              
  EQPTree           1x1              5058  struct              
  HJMInstSet        1x1             15948  struct              
  HJMTree           1x1              5838  struct              
  HWInstSet         1x1             15946  struct              
  HWTree            1x1              5904  struct              
  ITTInstSet        1x1             12438  struct              
  ITTTree           1x1              8862  struct              
  ZeroInstSet       1x1             10282  struct              
  ZeroRateSpec      1x1              1580  struct         

Examining a CRRTree

You can examine in some detail the contents of the CRRTree structure contained in this file.

CRRTree

       FinObj: 'BinStockTree'
       Method: 'CRR'
    StockSpec: [1x1 struct]
     TimeSpec: [1x1 struct]
     RateSpec: [1x1 struct]
         tObs: [0 1 2 3 4]
         dObs: [731582 731947 732313 732678 733043]
        STree: {[100]  [110.5171 90.4837]  [122.1403 100 81.8731]
               [1x4 double]  [1x5 double]}
      UpProbs: [0.7309 0.7309 0.7309 0.7309]

The Method field of the structure indicates that this is a CRR tree, not an EQP tree.

The fields StockSpec, TimeSpec and RateSpec hold the original structures passed into the function crrtree. They contain all the context information required to interpret the tree data.

The fields tObs and dObs are vectors containing the observation times and dates, the times and dates of the levels of the tree. In this particular case, tObs reveals that the tree has a maturity of 4 years (tObs(end) = 4) and that it has four time steps (the length of tObs is five).

The field dObs shows the specific dates for the tree levels, with a granularity of 1 day. This means that all values in tObs that correspond to a given day from 00:00 hours to 24:00 hours are mapped to the corresponding value in dObs. You can use the function datestr to convert these MATLAB serial dates into their string representations.

The field UpProbs is a vector representing the probabilities for up movements from any node in each level. This vector has 1 element per tree level. All nodes for a given level have the same probability of an up movement. In the specific case being examined, the probability of an up movement is 0.7309 for all levels, and the probability for a down movement is 0.2691 (1 - 0.7309).

Finally, the field STree contains the actual stock tree. It is represented in MATLAB as a cell array with each cell array element containing a vector of prices corresponding to a tree level. The prices are in descending order, that is, CRRTree.STree{3}(1) represents the topmost element of the third level of the tree, and CRRTree.STree{3}(end) represents the bottom element of the same level of the tree.

Examining an ITTTree

You can examine in some detail the contents of the ITTTree structure contained in this file.

TTTree = 

          FinObj: 'ITStockTree'
       StockSpec: [1x1 struct]
    StockOptSpec: [1x1 struct]
        TimeSpec: [1x1 struct]
        RateSpec: [1x1 struct]
            tObs: [0 1 2 3 4]
            dObs: [732678 733043 733408 733773 734139]
           STree: {1x5 cell}
           Probs: {[3x1 double]  [3x3 double]  [3x5 double]  [3x7 double]}

The fields StockSpec, StockOptSpec, TimeSpec, and RateSpec hold the original structures passed into the function itttree. They contain all the context information required to interpret the tree data.

The fields tObs and dObs are vectors containing the observation times and dates, the times and dates of the levels of the tree. In this particular case, tObs reveals that the tree has a maturity of 4 years (tObs(end) = 4) and that it has four time steps (the length of tObs is five).

The field dObs shows the specific dates for the tree levels, with a granularity of 1 day. This means that all values in tObs that correspond to a given day from 00:00 hours to 24:00 hours are mapped to the corresponding value in dObs. You can use the function datestr to convert these MATLAB serial dates into their string representations.

The field Probs is a vector representing the probabilities for movements from any node in each level. This vector has three elements per tree node. In the specific case being examined, at tObs= 1, the probability for an up movement is 0.4675, and the probability for a down movement is 0.1934.

Finally, the field STree contains the actual stock tree. It is represented in MATLAB as a cell array with each cell array element containing a vector of prices corresponding to a tree level. The prices are in descending order, that is, ITTTree.STree{4}(1) represents the top element of the fourth level of the tree, and ITTTree.STree{4}(end) represents the bottom element of the same level of the tree.

Isolating a Specific Node for a CRRTree

The function treepath can isolate a specific set of nodes of a binary tree by specifying the path used to reach the final node. As an example, consider the nodes touched by starting from the root node, then following a down movement, then an up movement, and finally a down movement. You use a vector to specify the path, with 1 corresponding to an up movement and 2 corresponding to a down movement. An up-down-up path is then represented as [2 1 2]. To obtain the values of all nodes touched by this path, enter:

SVals = treepath(CRRTree.STree, [2 1 2])

SVals =

  100.0000
   90.4837
  100.0000
   90.4837

The first value in the vector SVals corresponds to the root node, and the last value corresponds to the final node reached by following the path indicated.

Isolating a Specific Node for an ITTTree

The function trintreepath can isolate a specific set of nodes of a trinomial tree by specifying the path used to reach the final node. As an example, consider the nodes touched by starting from the root node, then following an up movement, then a middle movement, and finally a down movement. You use a vector to specify the path, with 1 corresponding to an up movement, 2 corresponding to a middle movement, and 3 corresponding to a down movement. An up-down-middle-down path is then represented as [1 3 2 3]. To obtain the values of all nodes touched by this path, enter:

pathSVals = trintreepath(ITTTree, [1 3 2 3])

pathSVals =

   50.0000
   66.3448
   50.0000
   50.0000
   37.6819

The first value in the vector pathSVals corresponds to the root node, and the last value corresponds to the final node reached by following the path indicated.

Differences Between CRR and EQP Tree Structures

In essence, the structures representing CRR trees and EQP trees are similar. If you create a CRR or an EQP tree using identical input arguments, only a few of the tree structure fields differ:

  


Free Interactive Computational Finance CD

View demos and recorded presentations led by industry experts.

Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS