Quant Memo
Core

Cubic Spline vs Piecewise Linear Curve Fitting

Interpolating between known points on a yield curve can be done with straight lines or with smooth cubic curves, and the choice trades off simplicity and stability against smoothness and how forward rates behave between the knots.

Prerequisites: Discount Factors and Curve Interpolation, Bootstrapping the Zero Curve

A curve builder knows zero rates at a handful of maturities — say 1, 2, 5, 10, and 30 years — from observable market instruments. But pricing a bond that pays a cash flow in year 7 requires a rate at exactly year 7, a point the market never quoted directly. Something has to fill in the gaps, and how it fills them in changes the price, the hedge ratios, and even whether the resulting curve looks financially sensible.

Piecewise linear interpolation connects known curve points with straight lines — simple, stable, and easy to reason about, but it produces kinked forward rates. Cubic spline interpolation fits smooth curves through the same points — visually appealing and smoother forwards, but more sensitive to the exact input points and prone to unwanted wiggles.

Piecewise linear

Between two known points (t1,z1)(t_1, z_1) and (t2,z2)(t_2, z_2), linear interpolation is just:

z(t)=z1+(z2z1)×tt1t2t1z(t) = z_1 + (z_2 - z_1) \times \frac{t - t_1}{t_2 - t_1}

In words: move a fraction of the way from z1z_1 to z2z_2 equal to how far tt has moved between t1t_1 and t2t_2. It's the simplest possible rule, entirely local — changing one input point only affects the curve in the segments touching that point — but the slope of the curve jumps abruptly at every input knot, which means the forward rate curve derived from it looks like a staircase of sudden jumps rather than something smooth.

Cubic spline

A cubic spline instead fits a separate cubic polynomial between each pair of knots, chosen so that the pieces join up smoothly — not just matching in level at each knot, but also matching in slope and curvature. This produces a visually smooth curve with continuous forward rates, which is usually closer to how real markets actually price nearby maturities relative to each other.

linear (kinked) cubic spline (smooth)
Both curves pass through the same known points; the linear version kinks sharply at each one, while the spline bends smoothly, at the cost of sometimes overshooting between widely spaced points.

Worked example

Known zero rates: 2-year at 3.00%, 5-year at 3.60%. Interpolate the 3-year rate.

  1. Piecewise linear: z(3)=3.00+(3.603.00)×3252=3.00+0.60×0.333=3.20%z(3) = 3.00 + (3.60 - 3.00) \times \frac{3-2}{5-2} = 3.00 + 0.60 \times 0.333 = 3.20\%.
  2. A cubic spline using these two points plus additional neighboring knots (say 1-year at 2.70% and 10-year at 3.90%) would fit a smooth curve through all four, typically landing close to but not exactly at the linear answer — often slightly higher or lower depending on the curvature implied by the neighboring points, precisely because the spline "looks beyond" just the two adjacent knots.
  3. Forward-rate check: the 2-to-5-year linear forward rate is a single constant number across that whole segment (a flat piece of the staircase), while the spline's forward rate over the same stretch continuously varies — closer to how forward rates observed in the market usually behave.

What this means in practice

Piecewise linear interpolation (often on log-discount-factors rather than rates directly) remains popular in production systems because it's numerically stable, fast, and entirely local — a data error at one maturity can't distort the curve far away. Cubic splines are preferred where smooth, continuous forward rates genuinely matter, such as pricing instruments sensitive to the curve's shape between quoted points, but they can overshoot ("wiggle") when input points are sparse or unevenly spaced, occasionally producing implied forward rates that go briefly negative or unrealistically high.

A cubic spline's smoothness is a two-edged sword: it can extrapolate an unrealistic hump or dip into a region with no real data support, simply because the polynomial is trying to satisfy smoothness conditions on both sides. Always sanity-check the forward curve implied by an interpolation method, not just the zero curve — that's where interpolation artifacts show up most clearly.

Related concepts

Practice in interviews

Further reading

  • Hagan and West, 'Interpolation Methods for Curve Construction'
ShareTwitterLinkedIn