| Financial Derivatives Toolbox™ | ![]() |
HWTree = hwtree(VolSpec, RateSpec, TimeSpec)
VolSpec | Volatility process specification. See hwvolspec for information on the volatility process. |
RateSpec | Interest-rate specification for the initial rate curve. See intenvset for information on declaring an interest-rate variable. |
TimeSpec | Tree time layout specification. Defines the observation dates of the HW tree and the compounding rule for date to time mapping and price-yield formulas. See hwtimespec for information on the tree structure. |
HWTree = hwtree(VolSpec, RateSpec, TimeSpec) creates a structure containing time and interest-rate information on a recombining tree.
Using the data provided, create a Hull-White volatility specification (VolSpec), rate specification (RateSpec), and tree time layout specification (TimeSpec). Then use these specifications to create a Hull-White tree using hwtree.
Compounding = -1;
ValuationDate = '01-01-2004';
StartDate = ValuationDate;
VolDates = ['12-31-2004'; '12-31-2005'; '12-31-2006';
'12-31-2007'];
VolCurve = 0.01;
AlphaDates = '01-01-2008';
AlphaCurve = 0.1;
Rates = [0.0275; 0.0312; 0.0363; 0.0415];
HWVolSpec = hwvolspec(ValuationDate, VolDates, VolCurve,...
AlphaDates, AlphaCurve);
RateSpec = intenvset('Compounding', Compounding,...
'ValuationDate', ValuationDate,...
'StartDates', ValuationDate,...
'EndDates', VolDates,...
'Rates', Rates);
HWTimeSpec = hwtimespec(ValuationDate, VolDates, Compounding);
HWTree = hwtree(HWVolSpec, RateSpec, HWTimeSpec)
HWTree =
FinObj: 'HWFwdTree'
VolSpec: [1x1 struct]
TimeSpec: [1x1 struct]
RateSpec: [1x1 struct]
tObs: [0 0.9973 1.9973 2.9973]
dObs: [731947 732312 732677 733042]
CFlowT: {[4x1 double] [3x1 double] [2x1 double] [3.9973]}
Probs: {[3x1 double] [3x3 double] [3x5 double]}
Connect: {[2] [2 3 4] [2 2 3 4 4]}
FwdTree: {1x4 cell}
Use treeviewer to observe the tree you have created.
treeviewer(HWTree)

hwprice, hwtimespec, hwvolspec, intenvset
![]() | hwtimespec | hwvolspec | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |