Sub topic 7
Fitting a Smooth Curve with Nelson-Siegel
Prerequisites and purpose
Assume you know spot rates, discount factors, par rates, and basic yield-curve movements. Nelson-Siegel is a compact mathematical model that fits a smooth curve to observed yields or forward rates. It is useful when market maturities are uneven or when you need rates for maturities that are not directly quoted.
A bootstrapped curve matches selected market instruments closely but can contain jumps between maturities. Nelson-Siegel sacrifices some exact matching to produce a smooth, interpretable curve.
The Nelson-Siegel equation
The continuously compounded spot yield for maturity t is:
y(t) = β0 + β1[(1 − exp(−t/τ))/(t/τ)] + β2[(1 − exp(−t/τ))/(t/τ) − exp(−t/τ)]
The parameters have these interpretations:
| Parameter | Main interpretation | Effect on the curve |
|---|---|---|
| β0 | Long-term level | Controls the yield as maturity becomes very large |
| β1 | Short-term slope | Controls the difference between short and long yields |
| β2 | Medium-term curvature | Creates or removes a hump |
| τ | Decay parameter | Controls where the curvature effect is concentrated |
At t approaching zero, the first loading approaches 1 and the second loading approaches 0. Therefore, the short-maturity yield approaches β0 + β1. As t becomes very large, both loading terms approach zero, so the yield approaches β0.
The curvature loading is zero at both very short and very long maturities. It reaches its greatest effect at an intermediate maturity, approximately related to τ. A larger τ moves this effect farther along the maturity axis.
import math
def nelson_siegel_yield(t, beta0, beta1, beta2, tau):
x = t / tau
level_loading = (1 - math.exp(-x)) / x
curvature_loading = level_loading - math.exp(-x)
return beta0 + beta1 * level_loading + beta2 * curvature_loading
parameters = (0.04, -0.02, 0.03, 2.0)
for maturity in [0.25, 1, 2, 5, 10, 30]:
rate = nelson_siegel_yield(maturity, *parameters)
print(f"{maturity:>5.2f} years: {rate:.2%}")Fitting and common errors
Fitting estimates β0, β1, β2, and τ by minimizing the differences between model yields and observed market yields. The chosen objective may weight every maturity equally or give more weight to liquid instruments. A fit to prices or discount factors may be preferable when pricing accuracy matters.
Nelson-Siegel is a descriptive curve model. A smooth fitted yield curve does not automatically produce an arbitrage-free curve. Its implied discount factors and forward rates should be checked for economically unreasonable values. The model can also fit today’s curve well while giving poor forecasts because its parameters are not guaranteed to be stable over time.
The extended Nelson-Siegel-Svensson model adds another curvature term. Use it only when the additional flexibility is justified, because extra parameters can make the fit unstable.
Exercise
If beta0 is 4%, beta1 is -2%, and beta2 is zero, what happens to the curve at very short and very long maturities?
Show answer
The short-maturity yield approaches beta0 + beta1 = 2%, while the long-maturity yield approaches beta0 = 4%. With beta2 equal to zero, there is no separate medium-term hump.