DURATION_MAC Function
Evaluates the modified Macauley duration of a security.
Usage
result = DURATION_MAC(settlement, maturity, coupon_rate, yield, frequency, basis)
Input Parameters
settlement—The date on which payment is made to settle a trade. For a more detailed discussion on dates see Chapter 8, Working with Date/Time Data in the PV‑WAVE User Guide.
maturity—The date on which the bond comes due, and principal and accrued interest are paid. For a more detailed discussion on dates see Chapter 8, Working with Date/Time Data in the PV‑WAVE User Guide.
coupon_rate—Annual interest rate set forth on the face of the security; the coupon rate.
yield—Annual yield of the security.
frequency—Frequency of the interest payments. It should be 1, 2, or 4.
1—One payment per year (Annual payment)
2—Two payments per year (Semi-annual payment)
4—Four payments per year (Quarterly payment)
basis—The method for computing the number of days between two dates. It should be 0, 1, 2, 3, or 4.
0—Actual/Actual
1—US (NASD) 30/360
2—Actual/360
3—Actual/365
4—European 30/360
Returned Value
result—The modified Macauley duration of a security is returned. The security has an assumed par value of $100. If no result can be computed, NaN is returned.
Input Keywords
Double—If present and nonzero, double precision is used.
Discussion
Function DURATION_MAC computes the modified Macauley duration for a security with an assumed par value of $100.
It is computed using the following:
where duration is calculated from the function DURATION.
Example
In this example, DURATION_MAC computes the modified Macauley duration of a security with the settlement date of July 1, 1995, and maturity date of July 1, 2005, using the Actual/365 day count method.
settlement = VAR_TO_DT(1995, 7, 1)
maturity = VAR_TO_DT(2005, 7, 1)
coupon = .075
yield = .09
frequency = 2
basis = 3
PRINT, DURATION_MAC(settlement, maturity, coupon, yield, $
frequency, basis)
; PV-WAVE prints: 6.73871