Calculates the Macauley duration for an assumed par value of $100. Duration
is defined as the weighted average of the present value of cash flows, and is
used as a measure of a bond's price sensitivity to changes in yield.
Remarks:
The settlement date is the date a buyer purchases a coupon, such as a bond.
The maturity date is the date when a coupon expires.
settlement, maturity, frequency, and basis are truncated to
integers.
If settlement or maturity is not a valid date, an error is thrown.
If coupon < 0 or if yield < 0, an error is thrown.
If frequency is any number other than 1, 2, or 4, an error is
thrown.
Calculates the Macauley duration for an assumed par value of $100. Duration is defined as the weighted average of the present value of cash flows, and is used as a measure of a bond's price sensitivity to changes in yield.
Remarks:
settlement,maturity,frequency, andbasisare truncated to integers.settlementormaturityis not a valid date, an error is thrown.coupon<0or ifyield<0, an error is thrown.frequencyis any number other than1,2, or4, an error is thrown.basis<0or ifbasis>4, an error is thrown.settlement>=maturity, an error is thrown.The duration is calculated as:
When N > 1:
When N = 1: