🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
đŸ’ŧ Servicesâ„šī¸ Aboutâœ‰ī¸ ContactView Pricing Plansfrom $10

Yield Curve Models

Fintech AIđŸŸĸ Free Lesson

Advertisement

Yield Curve Models

Yield Curve Shapes and ModelsYield (%)MaturityNormalInvertedFlatHumpedNelson-SiegelLevel + Slope + Curvature3 ParametersSvenssonExtended with 2 Humps6 ParametersApplications: Bond Pricing | Duration/Convexity | Swap Valuation

What are Yield Curve Models?

Yield curve models describe the relationship between interest rates and time to maturity for debt instruments of equivalent credit quality. The yield curve is the most important reference point in fixed income markets, serving as the benchmark for pricing bonds, mortgages, swaps, and all interest rate derivatives. Its shape (normal, inverted, flat, humped) conveys information about expected future interest rates, inflation, and economic conditions.

Parametric yield curve models fit a smooth curve to observed market yields using a small number of interpretable parameters. The Nelson-Siegel model uses three parameters: level (long-term rate), slope (short-term vs. long-term spread), and curvature (medium-term hump). The Svensson extension adds two more parameters for a second curvature term, enabling more flexible fitting of complex curve shapes. These models provide smooth, arbitrage-free yield curves from a sparse set of market observations.

Dynamic term structure models describe how the yield curve evolves over time. Affine term structure models (ATSMs) express yields as linear functions of a small number of state variables (factors). The three-factor model captures level, slope, and curvature as latent factors that follow mean-reverting processes. These models enable bond pricing, risk-neutral valuation, and the computation of forward rates that underpin derivative pricing.

The practical applications of yield curve models are vast. Bond pricing discounts future cash flows using spot rates extracted from the curve. Duration and convexity measure interest rate risk exposure. Mortgage prepayment models use forward rate expectations. Swap valuation discounts floating and fixed rate cash flows. Asset-liability management matches the timing of assets and liabilities using term structure projections.

Mathematical Foundation

Nelson-Siegel Model

Where each parameter means:

  • y(tau) is the zero-coupon yield at maturity tau (in years)
  • beta_0 is the level factor (long-term yield as tau approaches infinity, the curve's asymptote)
  • beta_1 is the slope factor (short-term vs. long-term spread; negative beta_1 means normal upward slope)
  • beta_2 is the curvature factor (medium-term hump magnitude)
  • lambda is the decay parameter controlling the location of the maximum curvature (where the hump peaks)
  • The three loading factors (1, the level loading, and curvature loading) create the characteristic yield curve shapes

Svensson Extension

Where each parameter means:

  • beta_3 is the second curvature factor (captures additional hump or twist in the curve)
  • lambda_2 is the second decay parameter (controls the location of the second hump)
  • The Svensson model provides 6 parameters (3 betas + 2 lambdas + 1 lambda for first curvature) for fitting complex curve shapes
  • It can capture both short-end and long-end curvature that Nelson-Siegel cannot

Bond Pricing from Yield Curve

Where each parameter means:

  • P is the present value (price) of the bond
  • C_i is the coupon payment at time i
  • y(tau_i) is the zero-coupon yield at maturity tau_i extracted from the fitted yield curve
  • F is the face value (par value) of the bond
  • tau_n is the final maturity
  • The bond price is the sum of discounted cash flows using spot rates for each payment date

Duration and Convexity

Where each parameter means:

  • D is the Macaulay duration (weighted average time to receipt of cash flows, in years)
  • P is the bond price
  • dP/dy is the first derivative of price with respect to yield (price sensitivity)
  • Convexity is the second derivative, measuring the curvature of the price-yield relationship
  • Duration approximates price change for small yield moves; convexity improves the approximation for larger moves

Implementation

import numpy as np
from scipy.optimize import minimize

class YieldCurveModel:
    def __init__(self, maturities, yields):
        self.maturities = np.array(maturities)
        self.yields = np.array(yields)
        self.ns_params = None

    def nelson_siegel(self, tau, beta0, beta1, beta2, lam):
        tau = np.asarray(tau, dtype=float)
        loading1 = np.where(tau > 0, (1 - np.exp(-tau / lam)) / (tau / lam), 1.0)
        loading2 = np.where(tau > 0, loading1 - np.exp(-tau / lam), 0.0)
        return beta0 + beta1 * loading1 + beta2 * loading2

    def fit_nelson_siegel(self):
        def objective(params):
            beta0, beta1, beta2, lam = params
            fitted = self.nelson_siegel(self.maturities, beta0, beta1, beta2, lam)
            return np.sum((fitted - self.yields) ** 2)

        result = minimize(objective, x0=[0.05, -0.02, 0.01, 2.0],
                         method='Nelder-Mead')
        self.ns_params = result.x
        return {
            'level': round(result.x[0], 6),
            'slope': round(result.x[1], 6),
            'curvature': round(result.x[2], 6),
            'lambda': round(result.x[3], 4),
            'fit_error': round(result.fun, 8),
        }

    def get_yield(self, maturity):
        if self.ns_params is None:
            self.fit_nelson_siegel()
        return self.nelson_siegel(maturity, *self.ns_params)

    def price_bond(self, coupon_rate, face_value, maturity, coupons_per_year=2):
        n_coupons = int(maturity * coupons_per_year)
        coupon = face_value * coupon_rate / coupons_per_year
        cash_flows = np.full(n_coupons, coupon)
        cash_flows[-1] += face_value
        times = np.array([(i+1) / coupons_per_year for i in range(n_coupons)])
        yields = np.array([self.get_yield(t) for t in times])
        discount_factors = 1 / (1 + yields / coupons_per_year) ** (times * coupons_per_year)
        return float(np.sum(cash_flows * discount_factors))

    def calculate_duration(self, coupon_rate, face_value, maturity, dy=0.001):
        price = self.price_bond(coupon_rate, face_value, maturity)
        # Bump yields
        original_params = self.ns_params.copy() if self.ns_params is not None else None
        self.ns_params = self.ns_params.copy()
        self.ns_params[0] += dy
        price_up = self.price_bond(coupon_rate, face_value, maturity)
        self.ns_params[0] -= 2 * dy
        price_down = self.price_bond(coupon_rate, face_value, maturity)
        self.ns_params = original_params
        duration = -(price_up - price_down) / (2 * price * dy)
        convexity = (price_up - 2 * price + price_down) / (price * dy**2)
        return {'duration': round(duration, 4), 'convexity': round(convexity, 4)}

    def forward_rate(self, t1, t2):
        r1 = self.get_yield(t1)
        r2 = self.get_yield(t2)
        forward = (r2 * t2 - r1 * t1) / (t2 - t1)
        return round(forward, 6)

# --- Example ---
maturities = [0.25, 0.5, 1, 2, 3, 5, 7, 10, 20, 30]
yields = [0.042, 0.043, 0.044, 0.045, 0.046, 0.047, 0.048, 0.049, 0.050, 0.051]

model = YieldCurveModel(maturities, yields)
params = model.fit_nelson_siegel()
print("Nelson-Siegel Parameters:")
print(f"  Level (beta0): {params['level']:.4f}")
print(f"  Slope (beta1): {params['slope']:.4f}")
print(f"  Curvature (beta2): {params['curvature']:.4f}")
print(f"  Lambda: {params['lambda']:.4f}")
print(f"  Fit Error: {params['fit_error']:.8f}")

bond_price = model.price_bond(coupon_rate=0.05, face_value=1000, maturity=10)
print(f"\n10Y 5% Coupon Bond Price: ${bond_price:.2f}")

risk = model.calculate_duration(0.05, 1000, 10)
print(f"Duration: {risk['duration']}")
print(f"Convexity: {risk['convexity']}")

fwd = model.forward_rate(2, 5)
print(f"\n2Y-5Y Forward Rate: {fwd:.4%}")

Performance Metrics

ModelParametersRMSE (bps)InterpretabilityFlexibility
Nelson-Siegel45-15HighLimited
Svensson62-8MediumHigh
cubic splinemany1-3LowVery High
Dynamic Factor3-53-10HighHigh
HJM Frameworkmany1-5MediumVery High

Real-World Case Study

The Federal Reserve uses the Svensson model to construct the official US Treasury yield curve (H.15 release). The Fed estimates the curve daily from a set of benchmark Treasury securities, publishing the parameters that enable anyone to derive zero-coupon yields for any maturity. The model's 6 parameters capture the full complexity of the Treasury curve including the occasional hump during monetary policy transitions.

PIMCO (Pacific Investment Management Company) uses dynamic factor models with 5 latent factors to price $2T+ in fixed income assets. Their term structure model captures level, slope, curvature, and two additional factors representing inflation expectations and monetary policy stance. The model enables relative value analysis identifying bonds mispriced relative to the term structure, generating 20-50 bps of excess return annually.

Common Challenges

  1. Extrapolation stability: Fitted yield curves can produce unreasonable yields at very short or very long maturities. Constrained optimization and regularization techniques ensure economically sensible extrapolation.

  2. Regime changes: Yield curve relationships change during monetary policy shifts (rate hiking vs. cutting cycles). Time-varying parameter models and regime-switching frameworks adapt to changing dynamics.

  3. Liquidity premiums: Treasury yields contain liquidity premiums that vary over time. Separating true risk-neutral rates from liquidity effects is essential for accurate forward rate estimation.

  4. Multi-curve environment: Post-2008, the single-curve framework (LIBOR-based) gave way to multi-curve discounting (OIS) and projection (LIBOR/swap) curves. Pricing requires careful curve decomposition.

  5. Negative rates: Traditional Nelson-Siegel struggles with negative rates. Extended models and shifted versions accommodate the negative rate environment observed in Europe and Japan.

Summary

Yield curve models fit smooth term structures to observed market yields using parametric (Nelson-Siegel, Svensson) or dynamic factor approaches. The Nelson-Siegel model uses 3 interpretable parameters: level (beta_0), slope (beta_1), and curvature (beta_2) with a decay parameter (lambda). These models enable bond pricing, duration/convexity computation, and forward rate extraction.

Key Takeaways:

  • Nelson-Siegel: y(tau) = beta_0 + beta_1 * [(1-e^(-tau/lambda))/(tau/lambda)] + beta_2 * [loading1 - e^(-tau/lambda)]
  • Level (beta_0) is the long-term asymptote; Slope (beta_1) captures term premium; Curvature (beta_2) captures humps
  • Bond price is the sum of discounted cash flows using fitted spot rates
  • Duration measures price sensitivity to yield changes; convexity improves accuracy for larger moves
See Also

Need Expert Fintech Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement