Portfolio LabKnowledgeSign inCreate account

Bond math: calculating price, yield, duration, convexity and spreads

Advanced12 min read · 13 sources

Bond math means discounting every payment of a bond and reading off price, yield and risk from those present values. This article works through everything with one example bond: from price and accrued interest, through spot and forward rates, to duration, convexity, spreads, carry and inflation-linked bonds. What duration means is explained in the article duration, and the shapes of the yield curve in the article yield curve; this one is about the calculations.

Price of a bond: the present value of all payments

A bond with a fixed coupon pays interest regularly until maturity and repays the nominal value at the end. Its fair price is the present value of these payments. With a single yield y for all maturities:

P = Σ_{k=1..N} (C / f) / (1 + y / f)^k + 100 / (1 + y / f)^N
P
price per 100 nominal, including accrued interest (dirty price)
C
coupon in percent of nominal value per year
f
coupon payments per year: 2 for US Treasuries, 1 for German Bunds
N
number of remaining coupon dates
y
yield to maturity per year
Payments of the example bond and their present values today

Coupons drawn to scale, the redemption shortened; dashed is the coupon before discounting. All five coupons together are worth 13.36 today, the redemption 82.19. In the fifth year, the coupon (2.47) and the redemption together come to 84.66.

Accrued interest, clean and dirty price, day count conventions

Interest accrues between two coupon dates. The buyer pays the seller this accrued interest on top and in return receives the full coupon on the next date. The clean price is quoted without accrued interest; the dirty price (full price) = clean price + accrued interest is what is paid (see clean and dirty price). That is why the clean price does not jump on the coupon date, but the dirty price does. How the days are counted is set by the day count convention of the bond in question (Tuckman and Serrat 2012).

Accrued interest = C / f × elapsed fraction of the current coupon period; dirty price = clean price + accrued interest
act/act (ICMA)
actual days since the last coupon / actual days in the coupon period
30/360
every month counts as 30 days, the year as 360 days
act/360
actual days / 360, common in the money market

For euro government bonds, act/act is usual; in the euro money market, act/360; and for the fixed leg of euro interest rate swaps and many US corporate bonds, 30/360. The bond's terms and conditions are always what counts. Yields also depend on the convention: a money market rate of 4% on an act/360 basis corresponds to 4.06% on an act/365 basis.

Yield to maturity and its assumptions

The yield to maturity (YTM) is the single rate y that makes the price formula equal the market price, mathematically the bond's internal rate of return. You find y numerically, for example with Newton's method. For the example bond at a price of 95.55, it comes out at exactly 4%. The figure is convenient, but it rests on three assumptions:

  • Holding to maturity: if you sell earlier, you get the price prevailing at that time.
  • Reinvestment at y: all coupons are reinvested at the same yield. If interest rates fall, the actual return falls short of it.
  • No default, no call: for corporate bonds, the YTM is the best-case return.

A single yield for all payments is also a simplification: two bonds with the same maturity but different coupons have different yields when the yield curve is curved (the coupon effect). It is cleaner to use a separate rate for each payment date.

Spot rates, forward rates and bootstrapping

A spot rate z_t is the yield of a zero-coupon bond with maturity t. With spot rates, each payment is discounted at its own rate. Because zero-coupon bonds do not exist for every maturity, spot rates are derived step by step from coupon bonds or swap rates: the one-year discount factor follows from the one-year rate, the two-year factor from the two-year rate and the first factor, which is already known. This procedure is called bootstrapping. Between the nodes you have to interpolate; Hagan and West (2006) show that many common methods produce implausible forward rates or unconvincing hedges.

DF_n = (1 − c_n × Σ_{k<n} DF_k) / (1 + c_n); z_n = DF_n^(−1/n) − 1; f_{n−1,n} = DF_{n−1} / DF_n − 1
c_n
par rate (coupon of a bond priced at 100) for n years, annual payment
DF_n
discount factor: today's value of $1 paid in n years
f_{n−1,n}
one-year forward rate from year n − 1 to year n
Par, spot and forward rates of the example curve

Figures from the example curve above; the forward rate for the year from n − 1 to n is plotted at maturity n. With an upward-sloping curve, spot rates are above par rates and forward rates are higher still.

Duration, DV01 and convexity: a worked example

The definitions of Macaulay duration, modified duration and convexity are in the article duration. Here are the figures for the example bond:

ΔP / P ≈ −D_mod × Δy + ½ × C × Δy²; D_eff = (P₋ − P₊) / (2 × P₀ × Δy); C_eff = (P₊ + P₋ − 2 × P₀) / (P₀ × Δy²)
Δy
change in yield as a decimal (100 bp = 0.01)
P₊, P₋
price after shifting the yield by +Δy or −Δy
D_eff, C_eff
effective duration and convexity from a valuation model, needed for bonds with call features

With Δy = 10 basis points, the effective formulas again give 4.53 and 25.60 for the example bond; without options, both approaches are equivalent. For callable bonds and mortgage-backed securities, P₊ and P₋ are valued with an interest rate model that takes exercise into account. There, convexity can become negative. The key rate durations of Ho (1992) distribute the duration across maturity points: if, in a flat spot curve at 4%, you shift the 1-, 2-, 3- and 5-year points individually (with the payment after 4 years split half each between 3 and 5), you get 0.03 / 0.06 / 0.13 / 4.31, which again add up to 4.53.

Spread measures: G-spread, I-spread, Z-spread, OAS and asset swap spread

If the example bond is a corporate bond, its 4% contains a premium for default and liquidity risk, the credit spread. Its size depends on the reference curve and the method of calculation (O'Kane and Sen 2005). The reference here is the example curve as the swap curve and an assumed five-year government bond yielding 2.70%:

MeasureCalculationExample
G-spreadYTM minus the yield of a government bond with the same maturity4.00 − 2.70 = 130 bp
I-spreadYTM minus the swap rate for the same maturity4.00 − 2.90 = 110 bp
Z-spreadconstant spread over all spot rates of the swap curve at which the present value matches the market price110.1 bp
Asset swap spread (par/par)(price on the swap curve − market price) / annuity of the swap curve(100.46 − 95.55) / 4.628 = 106.2 bp
OASZ-spread after deducting the value of embedded options, using an interest rate modelequal to the Z-spread without options

For bonds without options, the Z-spread is the cleanest measure because it uses the shape of the curve. The asset swap spread is the spread over the floating rate for someone who buys the bond and swaps its fixed coupons into floating ones; below par it is lower than the Z-spread, above par higher. The option-adjusted spread requires an interest rate model: for a bond callable by the issuer, it is smaller than the Z-spread, because part of the spread merely pays for the call option that the investor has sold. The sensitivity to spread changes is measured by spread duration.

Carry and roll-down: the return with an unchanged curve

If the yield curve stays the same, a bond earns its coupon (carry) plus the roll-down: it gets shorter and, with an upward-sloping curve, slides down to a lower yield, so its price rises. For a short period Δt, the following formula holds approximately; the Carry backtest also uses it:

Return ≈ y_n × Δt + D × (y_n − y_{n−Δt})
y_n
yield for maturity n
y_{n−Δt}
yield for the maturity that is Δt shorter, linearly interpolated between nodes
D
modified duration; for a par bond, D = (1 − (1 + y/f)^(−f·n)) / y

Carry is a forecast assuming unchanged prices, not a guaranteed return. Koijen et al. (2018) found for many asset classes, including government bonds, that high carry predicted higher returns; in global recessions, however, carry strategies performed poorly in all asset classes at the same time. More under carry trade.

Inflation-linked bonds: real yield and breakeven

With a linker, the nominal value and coupon grow with a price index, in the euro area usually the HICP excluding tobacco. Price and yield are quoted in real terms: the real yield is the real interest rate you receive if inflation follows the index exactly. The comparison with a nominal bond of the same maturity is given by the Fisher equation:

Breakeven = (1 + y_nominal) / (1 + y_real) − 1 ≈ y_nominal − y_real
y_nominal
yield of a nominal bond
y_real
real yield of a linker with the same maturity

Breakeven inflation is not simply expected inflation. It contains an inflation risk premium (Bekaert and Wang 2010) and is distorted by the poorer tradability of linkers: D'Amico et al. (2018) found that yields on US Treasury inflation-protected securities were up to 100 basis points above the risk-free real rate after their introduction, and up to 300 basis points in the 2007–2008 financial crisis, mainly because of lower liquidity. The duration of a linker measures real interest rate risk. More under real return.

For advanced readers: hedging and closed-form formulas

  • Fisher-Weil duration: each payment is discounted at its spot rate and the whole spot curve is shifted; with a flat curve, this again gives the modified duration, as the sum of the key rates above shows.
  • Hedging via DV01: to hedge $1 million of the example bond (DV01 $432.68) against interest rate changes, you sell a ten-year par bond yielding 2.6% (duration 8.71, DV01 $870.70 per million) with a nominal value of 432.68 / 870.70 = $0.50 million. This protects against parallel shifts, not against twists in the curve.
  • Par bond: for a bond priced at par, D = (1 − (1 + y/f)^(−f·n)) / y; as y tends to zero, D tends to the maturity n. A perpetual bond has a Macaulay duration of (1 + y) / y, i.e. 26 years at 4%, regardless of the coupon.
  • Portfolio: a portfolio's duration and convexity are the market-value-weighted averages of the individual values. A barbell of short and long bonds is more convex than a single bond with the same duration.

What the research shows

  • Macaulay (1938) introduced duration as the average time to the bond's payments.
  • Redington (1952) formulated immunization for insurers: equal duration of assets and liabilities. Fisher and Weil (1971) showed with US data that a strategy with matching duration reached a fixed investment target more reliably than one with matching maturity.
  • Litterman and Scheinkman (1991) found that three common factors (level, slope and curvature) explain most of the movements in bond yields. This is the basis of factor models for interest rate risk.
  • Campbell and Shiller (1991) showed that a steep curve heralded rising short-term rates in the long run but falling long-term yields in the short run. So forward rates are not pure expectations.
  • Cochrane and Piazzesi (2005) found a single tent-shaped factor built from forward rates that predicted the excess returns of one- to five-year bonds over one year with an R² of up to 0.44. It was countercyclical, and an important part of it is not contained in level, slope and curvature.

Limitations and common mistakes

  • Confusing clean and dirty: price comparisons across a coupon date need the clean price; present values and yields need the dirty price.
  • Mixing conventions: if you mix up act/360 and act/365, you can quickly be several basis points off.
  • Overstretching approximations: duration and convexity apply to small, parallel shifts; for large jumps or twists in the curve, only a full revaluation helps.
  • Comparing spreads: the G-, I- and Z-spreads of the same bond differ from one another, in the example between 106 and 130 basis points. Comparisons only make sense using the same measure.

How Portfolio Lab calculates it

There is no tool for individual bonds; the formulas are used in three places. The Carry backtest treats each maturity on the yield curve as a par bond with the duration from above and its convexity (US Treasuries with two coupons a year, German Bunds with one), expects carry plus roll-down and realizes y × Δt − D × Δy + ½ × C × Δy² per month (carry methodology).

The Asset classes extend bond funds backwards with synthetic bonds: at each month-end, a bond with a constant remaining maturity is bought at par and valued one month later at the new yield with a maturity one month shorter, without defaults, calls or bid-ask spread (asset classes methodology). The Look-through takes the duration of each bond from the fund's holdings list; if it is missing, it calculates the modified duration from maturity and coupon assuming an annual coupon (yield from the file, otherwise equal to the coupon, and 3% if there is no coupon) and distributes it across key rates from 1 to 30 years (risk factors methodology). The app does not calculate accrued interest, spot curves or Z-spreads.

Frequently asked questions

How do you calculate the price of a bond?

You discount each coupon and the redemption at the yield and add up the present values. A five-year bond with a 3% coupon costs 95.55 per 100 nominal at a 4% yield.

What is the difference between clean price and dirty price?

The clean price is the quoted price without accrued interest; the dirty price is the amount actually paid, including accrued interest. Immediately after a coupon date, the two are equal.

How accurate is the approximation with duration and convexity?

Very accurate for yield changes of up to about one percentage point, to within 0.01 percentage points in the example. For larger jumps and for callable bonds, you should revalue the bond.

What is the Z-spread?

The constant spread over all spot rates of a reference curve at which a bond's present value exactly equals its market price. For bonds without options, it is regarded as the most accurate spread measure.

What does breakeven inflation mean?

The inflation rate at which an inflation-linked bond and a nominal bond of the same maturity deliver the same return. It is roughly the nominal yield minus the real yield. However, it also contains risk and liquidity premia.

Literature

  1. Bekaert, Geert; Wang, Xiaozheng (2010): Inflation risk and the inflation risk premium. Economic Policy 25 (64), pp. 755–806. doi:10.1111/j.1468-0327.2010.00253.x
  2. Campbell, John Y.; Shiller, Robert J. (1991): Yield Spreads and Interest Rate Movements: A Bird's Eye View. The Review of Economic Studies 58 (3). doi:10.2307/2298008
  3. Cochrane, John H.; Piazzesi, Monika (2005): Bond Risk Premia. American Economic Review 95 (1), pp. 138–160. doi:10.1257/0002828053828581
  4. D'Amico, Stefania; Kim, Don H.; Wei, Min (2018): Tips from TIPS: The Informational Content of Treasury Inflation-Protected Security Prices. Journal of Financial and Quantitative Analysis 53 (1), pp. 395–436. doi:10.1017/s0022109017000916
  5. Fisher, Lawrence; Weil, Roman L. (1971): Coping with the Risk of Interest-Rate Fluctuations: Returns to Bondholders from Naive and Optimal Strategies. The Journal of Business 44 (4). doi:10.1086/295402
  6. Hagan, Patrick S.; West, Graeme (2006): Interpolation Methods for Curve Construction. Applied Mathematical Finance 13 (2), pp. 89–129. doi:10.1080/13504860500396032
  7. Ho, Thomas S.Y. (1992): Key Rate Durations. The Journal of Fixed Income 2 (2), pp. 29–44. doi:10.3905/jfi.1992.408049
  8. Koijen, Ralph S. J.; Moskowitz, Tobias J.; Pedersen, Lasse Heje; Vrugt, Evert B. (2018): Carry. Journal of Financial Economics 127 (2), pp. 197–225. doi:10.1016/j.jfineco.2017.11.002
  9. Litterman, Robert B; Scheinkman, Josè (1991): Common Factors Affecting Bond Returns. The Journal of Fixed Income 1 (1), pp. 54–61. doi:10.3905/jfi.1991.692347
  10. Macaulay, Frederick 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. Source
  11. O'Kane, Dominic; Sen, Saurav (2005): Credit spreads explained. The Journal of Credit Risk 1 (2), pp. 61–78. doi:10.21314/jcr.2005.009
  12. Redington, F. M. (1952): Review of the Principles of Life-office Valuations. Journal of the Institute of Actuaries 78 (3), pp. 286–340. doi:10.1017/s0020268100052811
  13. Tuckman, Bruce; Serrat, Angel (2012): Fixed Income Securities: Tools for Today's Markets. Wiley, 3rd edition.

Full bibliography

This article explains a method; it is not investment or tax advice. Worked examples are simplified and rounded. All terms in the glossary.