Specify time structure for Heath-Jarrow-Morton interest-rate tree
TimeSpec = hjmtimespec(ValuationDate,
Scalar date marking the pricing date and first observation in the tree. Specify as serial date number or date string.
Number of levels (depth) of the tree. A number of levels (NLEVELS)-by-1 vector of dates marking the cash flow dates of the tree. Cash flows with these maturities fall on tree nodes. Maturity should be in increasing order.
(Optional) Scalar value representing the rate at which the input zero rates were compounded when annualized. Default = 1. This argument determines the formula for the discount factors:
Compounding = 1, 2, 3, 4, 6, 12
Disc = (1 + Z/F)^(-T), where F is the compounding frequency, Z is the zero rate, and T is the time in periodic units; for example, T = F is 1 year.
Compounding = 365
Disc = (1 + Z/F)^(-T), where F is the number of days in the basis year and T is a number of days elapsed computed by basis.
Compounding = -1
Disc = exp(-T*Z), where T is time in years.
TimeSpec is a structure specifying the time layout for hjmtree. The state observation dates are [Settle; Maturity(1:end-1)]. Because a forward rate is stored at the last observation, the tree can value cash flows out to Maturity.
This example shows how to specify an eight-period tree with semiannual nodes (every six months) and use exponential compounding to report rates.
Compounding = -1; ValuationDate = '15-Jan-1999'; Maturity = datemnth(ValuationDate, 6*(1:8)'); TimeSpec = hjmtimespec(ValuationDate, Maturity, Compounding)
TimeSpec = FinObj: 'HJMTimeSpec' ValuationDate: 730135 Maturity: [8x1 double] Compounding: -1 Basis: 0 EndMonthRule: 1