Documentation Center

  • Trial Software
  • Product Updates

date2time

Time and frequency from dates

Syntax

[TFactors, F] = date2time(Settle, Maturity, Compounding, Basis,
EndMonthRule)

Arguments

Settle

Settlement date. A vector of serial date numbers or date strings.

Maturity

A vector of serial maturity dates.

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, for example, 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.

Basis

(Optional) Day-count basis of the instrument. A vector of integers.

  • 0 = actual/actual (default)

  • 1 = 30/360 (SIA)

  • 2 = actual/360

  • 3 = actual/365

  • 4 = 30/360 (PSA)

  • 5 = 30/360 (ISDA)

  • 6 = 30/360 (European)

  • 7 = actual/365 (Japanese)

  • 8 = actual/actual (ISMA)

  • 9 = actual/360 (ISMA)

  • 10 = actual/365 (ISMA)

  • 11 = 30/360E (ISMA)

  • 12 = actual/365 (ISDA)

  • 13 = BUS/252

For more information, see basis.

EndMonthRule

(Optional) End-of-month rule. A vector. This rule applies only when Maturity is an end-of-month date for a month having 30 or fewer days. 0 = ignore rule, meaning that a bond's coupon payment date is always the same numerical day of the month. 1 = set rule on (default), meaning that a bond's coupon payment date is always the last actual day of the month.

Description

[TFactors, F] = date2time(Settle, Maturity, Compounding, Basis, EndMonthRule) computes time factors appropriate to compounded rate quotes between the settlement and maturity dates.

TFactors is a vector of time factors.

F is a scalar of related compounding frequencies.

date2time is the inverse of time2date.

Definitions

The difference between yearfrac and date2time is that date2time counts full periods as a whole integer, even if the number of actual days in the periods are different. yearfrac does not count full periods. For example,

yearfrac('1/1/2000', '1/1/2001', 9)
ans =

    1.0167

yearfrac for Basis 9 (ACT/360 ISMA) will calculate 366/360 = 1.0167. So, even if the dates have the same month and date, with a difference of 1 in the year, the returned value may not be exactly 1. On the other hand, date2time will calculate one full year period:

date2time('1/1/2000', '1/1/2001', 1, 9)
ans =

     1

See Also

| | | |

Was this topic helpful?