Introduction
In our last two lessons, we explored two extremes for interpolating a yield curve. Linear interpolation was simple and stable but produced a jagged, discontinuous forward rate curve. Global polynomial interpolation offered perfect smoothness but proved wildly unstable and impractical, a victim of Runge's phenomenon. We are seeking a "best of both worlds" solution: one that is smooth like a polynomial but locally controlled and stable like linear interpolation.
This brings us to cubic splines, a cornerstone of numerical methods and the standard industry practice for yield curve construction. In this lesson, we will develop the mathematical intuition behind why cubic splines are so effective. Our goal is to understand how they are constructed to guarantee smooth, continuous yield and forward rate curves, resolving the issues we've previously encountered. We will focus on the theory and intuition, leaving the Python implementation for our next session.
1. The Visual Intuition of Smoothness and Continuity
Before diving into the equations, it's crucial to build a strong visual and intuitive understanding of what "smoothness" means mathematically. Smoothness is defined by different levels of continuity. In our context:
- continuity (Positional): The curve segments connect. The end of one piece is the start of the next. Linear interpolation achieves this, but it's not enough to avoid sharp corners.
- continuity (Velocity/Slope): The first derivative is continuous at the connection points (or "knots"). This means the slope of the curve is the same on both sides of a knot, eliminating sharp corners.
- continuity (Acceleration/Curvature): The second derivative is also continuous at the knots. This ensures that the rate of change of the slope (the curvature) is smooth, which is what our eyes perceive as a truly smooth curve without any subtle "hiccups".
The following video, though from the field of computer graphics, provides an outstanding visual explanation of these concepts. It will help you build a concrete mental model for the abstract derivative conditions we will discuss next.
In this video, "The Continuity of Splines," Freya Holmér provides an excellent visual deep-dive into the concepts of parametric and geometric continuity.
Please watch the following two segments: This first part introduces the hierarchy of parametric continuity, from C^0 (position) to C^1 (velocity). Focus on how mirroring the tangent points achieves C^1 continuity and what that looks like. Next, jump to the summary, which provides a concise comparison of the different levels of parametric (C) and geometric (G) continuity and their relationship. While watching, concentrate on the visual difference between a spline that is only C^0 continuous (like our linear interpolation) and one that is C^1 or C^2 continuous.
The key takeaway is that to create a curve that not only connects but also flows smoothly, we need to enforce continuity on its derivatives. For yield curves, we aim for continuity, ensuring a smooth spot curve and, as we'll see, a smooth forward curve.
2. The Mathematical Construction of a Cubic Spline
Now, let's formalize the intuition. A cubic spline is a series of piecewise cubic polynomials joined together smoothly. Suppose we have data points (knots) from our bootstrapping process, . This defines intervals. In each interval , the spot rate curve is represented by a separate cubic polynomial, .
The general form of the cubic polynomial in the -th interval is:
For intervals, we have such polynomials, each with 4 coefficients (). This gives us a total of unknown coefficients to solve for.
To find these coefficients, we impose a set of constraints that enforce the smoothness conditions we just discussed. The following video provides a clear, step-by-step derivation of these constraints.
Cubic Spline Interpolation (Part A) | Lecture 44 | Numerical Methods for Engineers
This lecture, "Cubic Spline Interpolation (Part A)" by Prof. Jeffrey Chasnov, walks through the mathematical setup of the problem.
Watch from the beginning of the lecture up to the point where the constraints are tallied. The notation is slightly different (using x, y and g(x)), but the principles are identical to our t, r and S(t). Focus on understanding how these four sets of constraints are formulated: The splines must pass through the data points: This enforces C^0 continuity. The first derivatives must be equal at the interior knots: This enforces C^1 continuity. The second derivatives must be equal at the interior knots: This enforces C^2 continuity.
Let's summarize the constraints from the video in our notation:
-
Interpolation conditions (): The curve must pass through all data points.
- For each interval , the spline must match the rate at the start: . This immediately gives . ( constraints)
- The last segment must also pass through the final point: . (1 constraint)
- Total: constraints.
-
Continuity of the function (, implicitly): The value at the end of one segment must equal the value at the start of the next.
- for .
- Total: constraints. (Note: Some texts combine constraints 1 and 2, leading to 2(n-1) constraints).
-
First derivative continuity (): The slope must be continuous at interior knots.
- for .
- Total: constraints.
-
Second derivative continuity (): The curvature must be continuous at interior knots.
- for .
- Total: constraints.
Summing these up: constraints for unknowns. There seems to be a discrepancy with the video's count of . Let's use the standard formulation which is clearer. For points and segments:
- Total unknowns: coefficients.
- Constraints:
- Spline passes through points and : constraints.
- First derivatives match at interior knots: constraints.
- Second derivatives match at interior knots: constraints.
- Total constraints: .
- Missing constraints: .
We have a system with unknowns and constraints. We are two constraints short of a unique solution. These two final constraints are applied at the boundaries (the first and last points) and define the specific type of cubic spline. A common choice is the natural cubic spline, which sets the second derivatives at the endpoints to zero:
This completes our system of equations, allowing us to solve for all coefficients and define a unique, smooth curve.
3. Why Cubic? The "Smoothest" Interpolation
We've established how to make a spline smooth, but why use cubic polynomials? Why not quadratic or quartic?
The answer lies in an elegant optimization principle. Intuitively, a "smooth" curve is one that doesn't bend any more than necessary. This "bending energy" can be quantified mathematically. For a function , the total squared curvature is a measure of its total "bendiness":
A remarkable theorem in numerical analysis states that the natural cubic spline is the unique interpolating function that minimizes this bending energy.
Smooth Interpolation of Zero Curves
This paper by Ken Adams provides the financial context for smoothness and formally defines it using the concept of strain energy.
Read the sections titled Smoothness and Smoothest zero-rate interpolation. Focus on these points: The analogy between the strain energy of an elastic spline used by draughtsmen and the mathematical measure of smoothness. The integral of the squared second derivative as the precise measure of this energy. The key result: "no interpolating function passing through the given data values is smoother than the cubic spline passing through the same points." The definition of the natural cubic spline (second derivatives are zero at endpoints) and the financial cubic spline (constraining the gradient at the long end).
- Quadratic splines () have a constant second derivative in each interval. It's generally impossible to make these constants equal at the knots, meaning you can't enforce continuity.
- Cubic splines are the lowest-degree polynomials that have enough flexibility (i.e., enough coefficients) to satisfy the continuity conditions across all interior knots.
- Higher-order splines (quartic, quintic) could also be used, but they are more complex and can re-introduce some of the oscillatory behavior we sought to avoid with global polynomials. The cubic spline provides the optimal balance of smoothness and simplicity.
4. Impact on the Forward Rate Curve
The primary motivation for moving beyond linear interpolation was to obtain a smooth forward rate curve. Let's see how cubic splines achieve this.
Recall the relationship between the spot rate and the instantaneous forward rate :
If we model our spot curve with a continuous cubic spline:
- is continuous (continuous up to the second derivative).
- Its derivative, , must therefore be continuous (continuous up to the first derivative).
- The forward rate is a sum and product of and functions. The result is that is continuous.
A continuous forward curve has a continuous slope, meaning it is visually smooth with no kinks or jumps. This is an economically sensible and practically useful property for pricing derivatives and managing risk.
While natural cubic splines are mathematically "optimal," papers like Hagan & West's "Interpolation Methods for Curve Construction" (which we referenced) note that in finance, they can sometimes produce undesirable artifacts like negative forward rates for certain data sets. This has led to specialized variations like the "financial cubic spline" or monotone preserving splines, but they are all built upon the fundamental principles of piecewise cubic interpolation we've covered today.
Conclusion
In this lesson, we have dissected the mathematical framework of cubic splines and understood why they are the industry-standard tool for yield curve construction.
Key Takeaways:
- Piecewise Construction: Cubic splines build a curve from a series of cubic polynomials, one for each interval between data points, providing local control and avoiding the global instability of Runge's phenomenon.
- Enforced Smoothness: Smoothness is achieved by imposing continuity constraints at the knots where the polynomial pieces connect. For a visually smooth curve, we require continuity: the function, its first derivative (slope), and its second derivative (curvature) must all be continuous.
- Optimality of "Cubic": Cubic polynomials are the simplest functions (lowest degree) that have enough parameters to satisfy the continuity conditions across a set of points. The resulting "natural cubic spline" is the smoothest possible interpolant, as it minimizes the total bending energy.
- Smooth Forward Rates: A continuous spot curve mathematically guarantees a continuous (smooth) forward rate curve , which was our primary objective.
We have now established the theoretical foundation. In the next lesson, we will transition from theory to practice by implementing cubic spline interpolation in Python and applying it to our bootstrapped yield curve data.