Nelson-Siegel Fitted Bond Curve

The Nelson-Siegel Model is the three-factor zero rate of Nelson and Siegel (1987): a level, a slope and one hump, with four parameters, a parsimonious form that fits the usual shapes of the yield curve.

The formula for the Nelson-Siegel Model builds the continuously compounded zero rate at a maturity of t years from the loadings of its factors. The slope loading \(L_{1}\) is 1 at the shortest maturity and decays to 0 at a speed set by the decay \(\tau_{1}\), and the curvature loading \(C_{1}\) is 0 at both ends and peaks in between:

\[L_{1} = \frac{1 - \exp\left(-\frac{t}{\tau_{1}}\right)}{\frac{t}{\tau_{1}}}\] \[C_{1} = L_{1} - \exp\left(-\frac{t}{\tau_{1}}\right)\]

The zero rate y(t) is the level plus each factor times its loading, and the discount function discounts at it continuously:

\[y_{t} = \beta_{0} + \beta_{1} \cdot L_{1} + \beta_{2} \cdot C_{1}\] \[d_{t} = \exp\left(-y_{t} \cdot t\right)\]

Where \(\beta_{0}\) is the level, the zero rate at an infinite maturity, \(\beta_{1}\) the slope, so that the shortest rate is \(\beta_{0} + \beta_{1}\), and \(\beta_{2}\) the curvature, a hump that peaks at about 1.8 times \(\tau_{1}\) years. It is the stiffest of the curves: its parameters are well identified and stable from day to day, but a single hump can miss the shape of the long end, which then shows up as a pattern in the residuals of the long bonds.

A constant maturity curve is quoted at a dozen maturities. Fitting the curve to the roughly 330 Treasury notes and bonds themselves gives the term structure that what trades implies, at every maturity, and measures each bond against it: a bond priced above the curve is rich, one priced below it cheap, the basis of relative value trading. The curve is a discount function d(t), the value today of 1 paid t years from now, and the methods differ in the shape they give it, from a parametric curve with a handful of parameters to a spline that follows the prices more closely.

The fit is the same for every discount function. Each bond’s price on the curve is its coupons and principal discounted with it:

\[\text{Model Price}_{i} = \sum \left(\text{CF}_{i,k} \cdot d(t_{i,k})\right)\]

The parameters of the discount function minimise the weighted squared differences between these prices and the market prices, with weights inversely proportional to duration, as Gürkaynak, Sack and Wright (2007) fit the Federal Reserve’s Treasury curve:

\[\text{Objective} = \sum_{i=1}^{N} w_{i} \cdot (\text{Model Price}_{i} - P_{i})^{2}\] \[w_{i} = \frac{1}{D_{i}}\]

Where \(P_{i}\) is the market price plus the accrued interest of bond i, \(\text{CF}_{i , k}\) its coupons and principal at times \(t_{i , k}\) in years, \(D_{i}\) its modified duration and N the number of bonds. A price error is about the duration times the price times the yield error, so the weights reduce the weight of the long bonds’ larger price errors, while still giving a basis point of a long bond more weight than one of a short bond (equal weight in yield would need weights of \(1 / D_{i}^{2}\)). The zero rates of the fitted curve are given annually compounded, while the parametric models are fitted on continuously compounded rates, so their parameters compare with the Federal Reserve’s; the instantaneous forward rate is continuously compounded, and the yields of the bonds are bond-equivalent, compounded twice a year, as the Treasury quotes them. A residual is the gap between a bond’s market price or yield and that on the curve: a positive price residual (a negative yield residual) marks a rich bond, a negative price residual a cheap one. Residuals reflect more than mispricing, such as the liquidity of the most recently issued bonds and the demand for particular bonds in the repo market.

Also known as: Nelson-Siegel curve, NS.

In the Finance Toolkit this is get_fitted_bond_curve with method="nelson_siegel", the same function as Fitted Bond Curve.

Example

Install the Finance Toolkit with pip install financetoolkit -U, then call get_fitted_bond_curve:

from financetoolkit import FixedIncome

fixedincome = FixedIncome()

fixedincome.get_fitted_bond_curve(method="nelson_siegel", date="2026-11-05")

Which returns:

References

  • Paper Nelson, C.R. and Siegel, A.F. (1987). “Parsimonious Modeling of Yield Curves.” The Journal of Business, 60(4), 473-489.
  • Paper Gürkaynak, R.S., Sack, B. and Wright, J.H. (2007). “The U.S. Treasury Yield Curve: 1961 to the Present.” Journal of Monetary Economics, 54(8), 2291-2304.
  • Library Shares similar logic as QuantLib’s NelsonSiegelFitting (Nelson-Siegel Model)
Share