Dates from time and frequency
Dates = time2date(Settle,Times,Compounding,Basis,EndMonthRule)
Settlement date. A vector of serial date numbers or date character vectors.
Vector of times corresponding to the compounding value.
(Optional) Scalar value representing the rate at which
the input zero rates were compounded when annualized. Default =
(Optional) Day-count basis of the instrument. A vector of integers.
For more information, see basis.
(Optional) End-of-month rule. A vector. This rule applies
Dates = time2date(Settle,Times,Compounding,Basis,EndMonthRule) computes
dates corresponding to compounded rate quotes between
To obtain accurate results from this function, the
must be consistent. If the
Dates argument contains
months that have 31 days,
Basis must be one of
the values that allow months to contain more than 30 days; for example,
time2date function is the inverse of
the inverse of each other. First compute the time factors using
Settle = '1-Sep-2002'; Dates = datenum(['31-Aug-2005'; '28-Feb-2006'; '15-Jun-2006'; '31-Dec-2006']); Compounding = 2; Basis = 0; EndMonthRule = 1; Times = date2time(Settle, Dates, Compounding, Basis,... EndMonthRule)
Times = 5.9945 6.9945 7.5738 8.6576
Now use the calculated
compare the calculated dates with the original set.
Dates_calc = time2date(Settle, Times, Compounding, Basis,... EndMonthRule) Dates_calc = 732555 732736 732843 733042 datestr(Dates_calc)
ans = 31-Aug-2005 28-Feb-2006 15-Jun-2006 31-Dec-2006