Cubic Spline Interpolation
Building a smooth curve through a set of points by stitching together many small, gentle cubic pieces instead of one wild high-degree polynomial — the standard, well-behaved way to construct a full yield or volatility curve from sparse quotes.
Prerequisites: Polynomial Interpolation
Fitting a single high-degree polynomial through many market quotes causes wild oscillation between the points — the previous concept's warning. The fix used almost everywhere in practice, from yield curves to volatility surfaces, is to give up on one global polynomial and use many small, low-degree pieces stitched together so the seams are invisible: matching not just in value but in slope and curvature. That's a cubic spline, the default smooth-curve-through-points tool in quantitative finance.
An analogy: bending a flexible ruler through pins
Picture pinning a thin, flexible strip of plastic (a physical "spline," the tool's namesake) at each data point and letting it bend naturally between the pins under its own stiffness. The strip passes exactly through every pin, but between pins it takes the smoothest, least-curved path physics allows — no sudden kinks, no wild bulges, because a real flexible strip simply can't do that. A cubic spline is the mathematical version: a separate small cubic (degree-3) polynomial on each interval between adjacent data points, chosen so the whole assembled curve looks and behaves exactly like that bent flexible strip.
The math, one piece at a time
A cubic spline uses a different cubic polynomial on each interval between consecutive data points, of the general form
In words: on each small piece, allow a cubic curve — flexible enough to bend and match both a slope and some curvature, but simple enough not to wildly overshoot the way a single global high-degree polynomial does. The coefficients on every piece are then chosen to satisfy matching conditions at each interior point where two pieces meet: the pieces must agree in value (so there's no gap), agree in first derivative or slope (so there's no visible kink), and agree in second derivative or curvature (so there's no sudden change in how sharply the curve bends) — three separate smoothness conditions enforced at every seam. Solving for all the coefficients across every piece simultaneously, subject to these matching conditions plus a choice of boundary condition at the two outer ends (commonly "natural," setting curvature to zero at the very ends), reduces to solving one linear system — in practice a tridiagonal one, solvable efficiently.
The key practical property: cubic splines match a polynomial's smoothness locally but never need a high global degree, so they don't suffer from Runge's phenomenon — adding more data points adds more small, well-behaved pieces rather than raising one global polynomial's degree.
Worked example 1: matching conditions by hand, conceptually
Suppose two adjacent spline pieces meet at (the 5-year point on a yield curve): the piece for ends at with value 4.0%, slope , and curvature . For the curve to be a genuine cubic spline, the piece for must start at with exactly the same three numbers. If the two pieces' slopes disagreed even slightly, the assembled curve would show a visible kink — a discontinuity that a genuine spline rules out by solving for all coefficients jointly.
Worked example 2: comparing to raw linear interpolation
Given yield points (1y, 3.0%), (5y, 4.0%), (10y, 4.5%), linear interpolation for the 3-year rate would just draw a straight line between the 1y and 5y points: . A cubic spline through the same three points, because it also has to match slope and curvature at the 5-year seam using information from the 10-year point too, typically produces a slightly different estimate — often closer to how an experienced trader would eyeball a naturally curving rate curve, since it doesn't force an artificial straight-line kink exactly at each quoted maturity the way linear interpolation does.
What this means in practice
Cubic splines are the default method for building a continuous yield curve or discount curve from a sparse set of quoted benchmark rates, for interpolating an implied volatility smile across strikes, and generally for any "smooth curve through market-observed points" task in quant finance. They're preferred over both raw linear interpolation (which has visible kinks, causing artifacts in derivatives computed from the curve, like forward rates) and single high-degree polynomials (which oscillate). The tradeoff for that smoothness is that a spline is a genuinely global construction — changing one input quote can, in principle, slightly perturb the curve everywhere, not just locally, since all the piece coefficients are solved jointly.
A cubic spline builds a smooth curve through data points using a separate small cubic polynomial on each interval, with matching value, slope, and curvature enforced at every seam — this gives smoothness comparable to a high-degree polynomial without that polynomial's tendency to oscillate wildly between the data points.
The classic mistake is assuming a cubic spline is purely a local construction — that changing or adding one data point only affects the curve nearby. Because natural (and most other) boundary conditions and the seam-matching conditions are solved as one linear system across all pieces simultaneously, a single new or corrected data point can, in principle, shift the fitted curve's shape at every other point too, even far away — usually only slightly, but not exactly zero. Don't assume a spline fit is "safe" to patch locally without re-solving the whole curve.
Related concepts
Practice in interviews
Further reading
- de Boor, A Practical Guide to Splines
- Press et al., Numerical Recipes, ch. 3