Main Content

hjmtree

Build Heath-Jarrow-Morton interest-rate tree

Description

HJMTree = hjmtree(VolSpec,RateSpec,TimeSpec) creates a structure containing time and forward-rate information on a bushy tree.

Note

Alternatively, you can use the IRTree object to price interest-rate instruments. For more information, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.

example

Examples

collapse all

Using the data provided, create a HJM volatility specification (using hjmvolspec), rate specification (using intenvset), and tree time layout specification (using hjmtimespec). Then use these specifications to create a HJM tree using hjmtree.

Compounding = 1;
ValuationDate = '01-01-2000';
StartDate = ['01-01-2000'; '01-01-2001'; '01-01-2002'; '01-01-2003'; '01-01-2004'];
EndDates = ['01-01-2001'; '01-01-2002'; '01-01-2003'; '01-01-2004'; '01-01-2005'];
Rates = [.1; .11; .12; .125; .13];
Volatility = [.2; .19; .18; .17; .16];
CurveTerm = [1; 2; 3; 4; 5]; 

HJMVolSpec = hjmvolspec('Stationary', Volatility , CurveTerm);

RateSpec = intenvset('Compounding', Compounding,...
                     'ValuationDate', ValuationDate,...
                     'StartDates', StartDate,...
                     'EndDates', EndDates,...
                     'Rates', Rates);

HJMTimeSpec = hjmtimespec(ValuationDate, EndDates, Compounding);
HJMTree = hjmtree(HJMVolSpec, RateSpec, HJMTimeSpec)
HJMTree = struct with fields:
      FinObj: 'HJMFwdTree'
     VolSpec: [1×1 struct]
    TimeSpec: [1×1 struct]
    RateSpec: [1×1 struct]
        tObs: [0 1 2 3 4]
        dObs: [730486 730852 731217 731582 731947]
        TFwd: {[5×1 double]  [4×1 double]  [3×1 double]  [2×1 double]  [4]}
      CFlowT: {[5×1 double]  [4×1 double]  [3×1 double]  [2×1 double]  [5]}
     FwdTree: {[5×1 double]  [4×1×2 double]  [3×2×2 double]  [2×4×2 double]  [1×8×2 double]}

Use treeviewer to observe the tree you have created.

treeviewer(HJMTree)

Figure Tree Viewer contains 2 axes objects and other objects of type uicontrol. Axes object 1 contains 61 objects of type line. Axes object 2 is empty.

Input Arguments

collapse all

Volatility process specification, specified using the VolSpec output obtained from hjmvolspec. VolSpec sets the number of factors and the rules for computing the volatility σ(t,T) for each factor.

Data Types: struct

Interest-rate specification for initial rate curve, specified by the RateSpec obtained from intenvset. For information on the interest-rate specification, see intenvset.

Data Types: struct

Time tree layout specification, specified using the TimeSpec output obtained from hjmtimespec. The TimeSpec defines the observation dates of the HJM tree and the Compounding rule for date to time mapping and price-yield formulas.

Data Types: struct

Output Arguments

collapse all

Time and interest-rate information of a bushy tree, returned as a structure.

More About

collapse all

Version History

Introduced before R2006a