Financial Derivatives Toolbox    
ratetimes

Change time intervals defining interest rate environment

Syntax

Usage 1: ValuationDate not passed; third through sixth arguments are interpreted as times.

Usage 2: ValuationDate passed and interval points input as dates.

Arguments

Compounding
Scalar value representing the rate at which the input zero rates were compounded when annualized. 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, e.g. T = F is one 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.
RefRates
NREFPTS-by-NCURVES matrix of reference rates in decimal form. RefRates are the yields over investment intervals from RefStartTimes, when the cash flow is valued, to RefEndTimes, when the cash flow is received.
RefEndTimes
NREFPTS-by-1 vector or scalar of times in periodic units ending the intervals corresponding to RefRates.
RefStartTimes
(Optional) NREFPTS-by-1 vector or scalar of times in periodic units starting the intervals corresponding to RefRates. Default = 0.
EndTimes
NPOINTS-by-1 vector or scalar of times in periodic units ending the interval to discount over.
StartTimes
(Optional) NPOINTS-by-1 vector or scalar of times in periodic units starting the interval to discount over. Default = 0.
RefEndDates
NREFPTS-by-1 vector or scalar of serial dates ending the intervals corresponding to RefRates.
RefStartDates
(Optional) NREFPTS-by-1 vector or scalar of serial dates starting the intervals corresponding to RefRates. Default = ValuationDate.
EndDates
NPOINTS-by-1 vector or scalar of serial maturity dates ending the interval to discount over.
StartDates
(Optional) NPOINTS-by-1 vector or scalar of serial dates starting the interval to discount over.
Default = ValuationDate.
ValuationDate
Scalar value in serial date number form representing the observation date of the investment horizons entered in StartDates and EndDates. Required in usage 2. Omitted or passed as an empty matrix to invoke usage 1.

Description

[Rates, EndTimes, StartTimes] = ratetimes(Compounding, RefRates, RefEndTimes, RefStartTimes, EndTimes, StartTimes) and [Rates, EndTimes, StartTimes] = ratetimes(Compounding, RefRates, RefEndDates, RefStartDates, EndDates, StartDates, ValuationDate) change time intervals defining an interest rate environment.

ratetimes takes an interest rate environment defined by yields over one collection of time intervals and computes the yields over another set of time intervals. The zero rate is assumed to be piecewise linear in time.

Rates is an NPOINTS-by-NCURVES matrix of rates implied by the reference interest rate structure and sampled at new intervals.

StartTimes is an NPOINTS-by-1 column vector of times starting the new intervals where rates are desired, measured in periodic units.

EndTimes is an NPOINTS-by-1 column vector of times ending the new intervals, measured in periodic units.

If Compounding = 365 (daily), StartTimes and EndTimes are measured in days. The arguments otherwise contain values, T, computed from SIA semiannual time factors, Tsemi, by the formula T = Tsemi/2 * F, where F is the compounding frequency.

The investment intervals can be specified either with input times (Usage 1) or with input dates (Usage 2). Entering the argument ValuationDate invokes the date interpretation; omitting ValuationDate invokes the default time interpretations.

Examples

Example 1.

The reference environment is a collection of zero rates at six, 12, and 24 months. Create a collection of one year forward rates beginning at zero, six, and 12 months.

Example 2.

Interpolate a zero yield curve to different dates. Zero curves start at the default date of ValuationDate.

See Also

disc2rate, rate2disc


  rate2disc swapbybdt