| Financial Derivatives Toolbox™ | ![]() |
itttree(StockSpec, RateSpec, TimeSpec,
StockOptSpec)
StockSpec | Stock specification. For more information, see stockspec. |
RateSpec | Interest rate specification of the initial risk-free rate curve. For more information on declaring an interest rate variable, see intenvset. |
TimeSpec | Tree time layout specification. Defines the observation dates of the implied trinomial tree. For more information on the tree structure, see itttimespec. |
StockOptSpec | Option stock specification. For more information, see stockoptspec. |
itttree(StockSpec, RateSpec, TimeSpec, StockOptSpec) creates the itttree structure specifying stock and time information for an implied trinomial tree.
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, create StockSpec, TimeSpec, and StockOptSpec structures.
To create theStockSpec structure:
Sigma = 0.20;
AssetPrice = 50;
DividendType = 'cash';
DividendAmounts = [0.50; 0.50; 0.50; 0.50];
ExDividendDates = {'03-Jan-2007'; '01-Apr-2007'; '05-July-2007';'01-Oct-2007'}
StockSpec = stockspec(Sigma, AssetPrice, DividendType, ...
DividendAmounts, ExDividendDates)
StockSpec =
FinObj: 'StockSpec'
Sigma: 0.2000
AssetPrice: 50
DividendType: 'cash'
DividendAmounts: [4x1 double]
ExDividendDates: [4x1 double]
The syntax for building a TimeSpec structure is TimeSpec = itttimespec(ValuationDate, Maturity, NumPeriods).
Consider building an ITT tree, with a valuation date of January 1, 2006; a maturity date of January 1, 2008; and four time steps.
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]The syntax for building a StockOptSpec structure is [StockOptSpec] = stockoptspec(OptPrice, Strike, Settle, Maturity, OptSpec).
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'Note In this example, the extrapolation warnings are turned on to display warnings on the Command Window. These warnings are a consequence of having to extrapolate to find the option price of the tree nodes. 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. |
Use the following command to turn on extrapolation warnings:
warning('on', 'finderiv:itttree:Extrapolation');Use the StockSpec, RateSpec, TimeSpec, and StockOptSpec structure to create an ITTTree.
ITTTree = itttree(StockSpec, RateSpec, TimeSpec, StockOptSpec)
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: 02-Jul-2006 Strike=60.7466
Option Type: 'put' Maturity: 02-Jul-2006 Strike=50.0731
Option Type: 'put' Maturity: 02-Jul-2006 Strike=41.3344
Option Type: 'call' Maturity: 01-Jan-2007 Strike=73.8592
Option Type: 'call' Maturity: 01-Jan-2007 Strike=60.8227
Option Type: 'put' Maturity: 01-Jan-2007 Strike=50.1492
Option Type: 'put' Maturity: 01-Jan-2007 Strike=41.4105
Option Type: 'put' Maturity: 01-Jan-2007 Strike=34.2559
Option Type: 'call' Maturity: 02-Jul-2007 Strike=88.8310
Option Type: 'call' Maturity: 02-Jul-2007 Strike=72.9081
Option Type: 'call' Maturity: 02-Jul-2007 Strike=59.8715
Option Type: 'put' Maturity: 02-Jul-2007 Strike=49.1980
Option Type: 'put' Maturity: 02-Jul-2007 Strike=40.4594
Option Type: 'put' Maturity: 02-Jul-2007 Strike=33.3047
Option Type: 'put' Maturity: 02-Jul-2007 Strike=27.4470
Option Type: 'call' Maturity: 01-Jan-2008 Strike=107.2895
Option Type: 'call' Maturity: 01-Jan-2008 Strike=87.8412
Option Type: 'call' Maturity: 01-Jan-2008 Strike=71.9183
Option Type: 'call' Maturity: 01-Jan-2008 Strike=58.8817
Option Type: 'put' Maturity: 01-Jan-2008 Strike=48.2083
Option Type: 'put' Maturity: 01-Jan-2008 Strike=39.4696
Option Type: 'put' Maturity: 01-Jan-2008 Strike=32.3150
Option Type: 'put' Maturity: 01-Jan-2008 Strike=26.4573
Option Type: 'put' Maturity: 01-Jan-2008 Strike=21.6614
> In itttree>InterpOptPrices at 675
In itttree at 277
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]}
intenvset, itttimespec, stockoptspec, stockspec
![]() | itttimespec | lookbackbycrr | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |