Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 14

Linear Interpolation and Discontinuous Forwards

Recommended resources

Introduction

In our last lesson, we built a Python function to perform bootstrapping, which allowed us to extract a discrete set of spot rates from market bond data. This was a crucial step, but it left us with spot rates only at specific maturities (e.g., 0.5, 1.0, 1.5, 2.0 years). What happens if we need to price a cash flow that falls between these points, say at 1.75 years? The market doesn't operate in discrete time steps, so we need a continuous curve.

This lesson marks our entry into advanced curve construction by exploring interpolation—the process of creating a continuous function from a set of discrete data points. We will start with the most intuitive method: linear interpolation. Your objective is to apply this technique to a discrete spot rate curve and, more importantly, to perform a critical analysis of its primary drawback, which becomes apparent when we derive the corresponding forward rates.


1. The Intuition of Linear Interpolation

At its core, linear interpolation is simply the process of "connecting the dots" with straight lines. Given a set of known data points, we assume the function behaves linearly between any two consecutive points.

This approach transforms our discrete set of spot rates into a continuous, albeit piecewise linear, function. To get a quick visual and conceptual overview of this idea, please watch the beginning of the following video.

Linear Spline Interpolation Theory | Numerical Methods

This video from StudySession provides a concise explanation of linear spline interpolation.

Please watch the first two minutes. Focus on these parts: The core concept of connecting data points with straight lines (first-order polynomials). The introduction of "knots", which are the sharp corners at our known data points. This is a key visual for understanding the drawbacks we'll discuss later. The general formula for a line segment between two points.


2. Mathematical Formulation and Implementation

Let's formalize this. Suppose we have two points from our bootstrapped spot curve, and , where is the maturity and is the continuously compounded spot rate. We want to find the spot rate for any maturity such that .

Since we assume a straight line between the two points, the slope is constant:

Using the point-slope form of a linear equation, , we can solve for :

This is the fundamental formula for linear interpolation. You can also view it as a weighted average of the two rates and , where the weights are determined by how close is to and .

Python Implementation

Now, let's translate this into a Python function. The function will take our discrete spot curve (as a dictionary) and a target maturity, and it will return the interpolated rate.

import numpy as np

def linear_interpolate(spot_curve_discrete, t):
    """
    Performs linear interpolation on a discrete spot curve.

    Args:
        spot_curve_discrete (dict): A dictionary mapping maturities to spot rates.
        t (float): The target maturity for which to find the spot rate.

    Returns:
        float: The interpolated spot rate at maturity t.
    """



    # Get the maturities and rates, and sort them
    maturities = sorted(spot_curve_discrete.keys())
    
    if t < maturities[0] or t > maturities[-1]:
        raise ValueError("Target maturity is outside the range of the curve. Extrapolation is not supported.")




    # If t is an exact knot, return the known rate
    if t in spot_curve_discrete:
        return spot_curve_discrete[t]




    # Find the two surrounding maturities
    # np.searchsorted finds the index where t would be inserted to maintain order
    idx = np.searchsorted(maturities, t)
    t_i = maturities[idx - 1]
    t_i1 = maturities[idx]
    
    r_i = spot_curve_discrete[t_i]
    r_i1 = spot_curve_discrete[t_i1]
    



    # Apply the linear interpolation formula
    r_t = r_i + (t - t_i) * (r_i1 - r_i) / (t_i1 - t_i)
    
    return r_t




# --- Example Usage ---
# A discrete spot curve from a hypothetical bootstrap
bootstrapped_curve = {
    0.5: 0.010,  # 1.0%
    1.0: 0.014,  # 1.4%
    1.5: 0.017,  # 1.7%
    2.0: 0.022   # 2.2%
}




# Find the spot rate for a maturity that's NOT in our discrete curve
target_maturity = 1.75
interpolated_rate = linear_interpolate(bootstrapped_curve, target_maturity)

print(f"Discrete spot curve: {bootstrapped_curve}")
print(f"Interpolated spot rate at {target_maturity} years: {interpolated_rate:.4%}")




# Let's check the result. 1.75 is exactly halfway between 1.5 and 2.0.
# So the rate should be the average of 1.7% and 2.2%, which is (0.017 + 0.022) / 2 = 0.0195.
# Our function should return 1.95%.

This implementation gives us a continuous spot rate curve . On the surface, this seems like a reasonable solution. However, the problems arise when we examine the implications for other fundamental rates.


3. The Primary Drawback: Discontinuous Forward Rates

The spot rate curve is not the only term structure we care about. The forward rate curve, which describes the market's expectation of future interest rates, is equally important, especially for pricing derivatives.

Recall from Module 2 the relationship between the continuously compounded spot rate and the instantaneous forward rate :

where is the first derivative of the spot rate function.

Let's analyze this for our linearly interpolated curve. Within any interval , the spot rate function is , where is the constant slope . The derivative is simply this slope .

So, for , the forward rate is:

The critical issue occurs at the knot points. At each maturity where we have a known data point, the slope of the spot curve changes abruptly.

  • The slope just before is .
  • The slope just after is .

Unless (i.e., the three points happen to lie on a single straight line), the derivative is discontinuous at . Consequently, the forward rate function will have a "jump" or discontinuity at every knot point.

To dive deeper into the mathematics of this flaw, please read the following excerpt.

An investigation into popular methods for constructing yield curves

This paper provides a rigorous analysis of various interpolation methods. We will focus on its formal treatment of linear interpolation.

Please read section 4.1 Linear Interpolation and subsection 4.1.1 Linear Interpolation on r(t). As you read, focus on: Equation (4.1.2): This is the same formula we derived for r(t). Equation (4.1.3): The derivation of the instantaneous forward rate, f(t), from the linearly interpolated spot rate function. The conclusion after Equation (4.1.5): The paper explicitly states that f(t) is "sure to have a discontinuity" at the knot points.

Why This Matters

Discontinuous forward rates are highly undesirable for several reasons:

  1. Economic Implausibility: A jump in the forward curve implies a belief that future short-term rates will move instantaneously and predictably at a specific future date, which makes little economic sense.
  2. Pricing Instability: Many financial derivatives, such as forward rate agreements (FRAs) and swaps, are priced directly off the forward curve. A discontinuous curve leads to unstable and unreliable pricing.
  3. Hedging Difficulties: Instabilities in the forward curve make it difficult to calculate stable hedge ratios (greeks), complicating risk management.

The following image provides a stark visualization of this problem. The spot curve (zero curve) is continuous and piecewise linear, but the derived forward curve exhibits significant jumps at each knot point.

Monthly Zero Curve and Forward Rate Curve with Linear Interpolation
This chart illustrates how a linearly interpolated zero curve (blue) results in a discontinuous forward rate curve (yellow). The red dots are the original discrete market rates. The blue line connects these dots smoothly in a piecewise linear fashion. However, the yellow forward curve, derived from the blue curve, jumps at each maturity where the slope of the zero curve changes.

Conclusion

In this lesson, we took a significant step toward building a continuous yield curve by applying linear interpolation. While simple to understand and implement, we've uncovered its critical flaw: it produces a continuous spot rate curve at the cost of a discontinuous forward rate curve.

Key Takeaways:

  • Linear interpolation creates a continuous spot rate curve by connecting discrete points with straight lines.
  • The formula for a rate between known points and is a weighted average: .
  • The primary drawback is that the first derivative of the spot curve, , is discontinuous at the knot points.
  • Because the instantaneous forward rate is defined as , the forward curve inherits this discontinuity, leading to jumps that are economically implausible and problematic for pricing and hedging.

The failure of linear interpolation to produce smooth forward rates naturally leads to the question: can we do better? If straight lines (first-degree polynomials) are problematic, perhaps smoother curves like higher-degree polynomials are the answer. In our next lesson, we will investigate this by applying polynomial interpolation and discovering that while it solves the continuity problem, it introduces a new, and equally problematic, instability.