Macaulay Duration
The Macaulay Duration is the weighted average time until the bond’s cash flows arrive, each weighted by its present value as a share of the price. Macaulay (1938) introduced it to compare the length of bonds with different coupons, as the maturity alone ignores that a high coupon returns much of the money early.
The formula for the Macaulay Duration starts by discounting every remaining cash flow \(\text{CF}_{t}\), paid t years from today, at the yield to maturity YTM, compounded twice a year:
\[\text{PV}_{t} = \frac{\text{CF}_{t}}{\left(1 + \frac{\text{YTM}}{2}\right)^{2 \cdot t}}\]These present values add up to the dirty price, the market price plus the accrued interest:
\[\text{Dirty Price} = \sum \text{PV}_{t}\]The Macaulay Duration is then the average payment time t, weighted by each cash flow’s share of that price:
\[\text{Macaulay Duration} = \frac{\sum \left(t \cdot \text{PV}_{t}\right)}{\text{Dirty Price}}\]Where the cash flows \(\text{CF}_{t}\) are the coupons, 100 times the annual coupon rate divided by 2 per half year, and the principal of 100 repaid with the last coupon, on the bond’s actual coupon dates. It is measured in years and never exceeds the maturity: a zero-coupon bond’s Macaulay Duration equals its maturity, and the higher the coupon, the shorter the duration. It is also the holding period over which a parallel shift in yields leaves the bond’s return about unchanged, as the price change and the reinvestment of the coupons offset each other, which is why it is the target of immunisation.
Duration sums up the interest rate risk of a bond in one number. A bond’s price is the present value of its coupons and principal, so when yields rise the price falls, and it falls further the later the cash flows arrive. Duration measures that lateness, or equivalently the sensitivity of the price to the yield, which makes bonds with different coupons and maturities comparable and lets a portfolio’s interest rate risk be added up and hedged. All duration measures here are taken at the bond’s yield to maturity, the one rate that discounts its cash flows to its market price, compounded twice a year (the bond-equivalent yield the Treasury and US corporate bond markets quote). Every duration is a first-order measure: it treats the price-yield relation as a straight line, so it understates the price for large yield moves in either direction, which convexity corrects, and it assumes the cash flows are fixed.
Also known as: Macaulay’s duration, weighted average time to cash flows.
In the Finance Toolkit this is get_duration with method="macaulay", the same function as Duration Metrics.
Example
Install the Finance Toolkit with pip install financetoolkit -U, then call get_duration:
from financetoolkit import FixedIncome
fixedincome = FixedIncome()
durations = fixedincome.get_duration(method="macaulay", date="2026-11-05")
durations[["Security Type", "Coupon", "Maturity", "Price", "Macaulay's Duration"]]
| Parameter | Type | Description | Example |
|---|---|---|---|
method | str | The duration measure. Options are: “modified” (Modified Duration, the percentage sensitivity), “macaulay” (Macaulay Duration, the weighted average time), “effective” (Effective Duration, from repricing at shifted yields), “dollar” (Dollar Duration, per 100 of face value). Defaults to “modified”. | "modified" |
bonds | list[str] | str | None | CUSIPs or ISINs, see collect_bond_statistics. Defaults to None. | None |
issuer | list[str] | str | None | Part of an issuer’s name, such as “Apple”. Defaults to None. | None |
etfs | list[str] | str | None | The bond ETFs to select bonds from, see get_bond_universe. Defaults to None. | None |
maturity_start | str | None | The earliest maturity (YYYY-MM-DD). Defaults to None. | None |
maturity_end | str | None | The latest maturity (YYYY-MM-DD). Defaults to None. | None |
date | str | None | The day of the Treasury prices (YYYY-MM-DD). Defaults to None, the latest day with prices. | "2025-03-31" |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the class. | 2 |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
Which returns:
| Item | Security Type | Coupon | Maturity | Price | Macaulay's Duration |
|---|---|---|---|---|---|
| 91282CRU7 | Note | 0.0462 | 2028-10-31 | 100.3120 | 1.9195 |
| 91282CLR0 | Note | 0.0412 | 2029-10-31 | 98.8750 | 2.8376 |
| 91282CRT0 | Note | 0.0475 | 2031-10-31 | 100.6880 | 4.4973 |
| 91282CRV5 | Note | 0.0488 | 2033-10-31 | 101.0620 | 6.0064 |
| 91282CRF0 | Note | 0.0462 | 2036-08-15 | 98.4375 | 7.8771 |
| 912810RU4 | Bond | 0.0288 | 2046-11-15 | 70.0312 | 13.9919 |
| 912810UW6 | Bond | 0.0512 | 2056-08-15 | 98.1250 | 15.2706 |
7 rows
References
- Paper Macaulay, F.R. (1938). “Some Theoretical Problems Suggested by the Movements of Interest Rates, Bond Yields and Stock Prices in the United States Since 1856.” National Bureau of Economic Research.
- Library Referenced against QuantLib’s BondFunctions.duration (Modified Duration, Macaulay Duration)