Nelson-Siegel-Svensson
Fits the Nelson-Siegel-Svensson model to the zero-coupon yield curve of a country on every date. The model describes a whole curve with a few parameters, which smooths out the noise of individual maturities, gives a yield for any maturity in between and turns the history of curves into a history of a handful of factors. It is the model central banks such as the ECB, the Bundesbank and the Federal Reserve (Gürkaynak, Sack and Wright) publish their curves with.
The Nelson-Siegel model has a level β0 (the yield at an infinite maturity), a slope β1 (the short end minus the long end) and a curvature β2 (a hump that peaks at about 1.8 τ1 years):
y(m) = β0 + β1 (1 - e^(-m/τ1)) / (m/τ1) + β2 [(1 - e^(-m/τ1)) / (m/τ1) - e^(-m/τ1)]
Svensson adds a second curvature β3 with its own decay τ2, which fits the long end better. With the dozen maturities a government curve has, the six Svensson parameters are weakly identified, as the level and the second curvature can offset each other; set svensson=False for the three factors to read as level, slope and curvature (Diebold and Li, 2006).
Given the decays the betas follow exactly from least squares, so the decays are searched on a grid and refined for every date. The second decay is kept at least 1.5 times the first and the first at least a third of the shortest maturity, and the level at or above the lower of zero and the longest yield (as Gürkaynak, Sack and Wright keep it at or above zero), so that the curve extrapolates sensibly beyond the maturities it is fitted to. The curve is the zero-coupon curve of get_zero_coupon_curve, so the countries are those it covers that have at least as many maturities as the model has parameters. The model is fitted to the continuously compounded rates, as the ECB, the Bundesbank and the Federal Reserve fit it, so the parameters compare with theirs; the yields at maturities are annually compounded, like those of get_zero_coupon_curve.
For more information, see the following papers:
- Nelson, C.R. and Siegel, A.F. (1987). “Parsimonious Modeling of Yield Curves.” The Journal of Business, 60(4), 473-489.
- Svensson, L.E.O. (1994). “Estimating and Interpreting Forward Interest Rates: Sweden 1992-1994.” NBER Working Paper 4871.
- Diebold, F.X. and Li, C. (2006). “Forecasting the Term Structure of Government Bond Yields.” Journal of Econometrics, 130(2), 337-364.
- 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.
Also known as: NSS, Svensson curve, Nelson-Siegel curve, yield curve fitting, level slope curvature factors.
Nelson-Siegel-Svensson in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_nelson_siegel_svensson as shown below.
from financetoolkit import FixedIncome
fixedincome = FixedIncome(start_date='2026-10-19', end_date='2026-10-23')
fixedincome.get_nelson_siegel_svensson(countries='Germany')
Or, after setting up the Finance Toolkit MCP, ask:
What were the Nelson-Siegel-Svensson parameters of Germany's yield curve on each day from 19 to 23 October 2026?
Which returns:
| Beta 0 | Beta 1 | Beta 2 | Beta 3 | Tau 1 | Tau 2 | Root Mean Squared Error | |
|---|---|---|---|---|---|---|---|
| 2026-10-19 | 0.0409 | -0.0173 | 0.0418 | -0.051 | 1.1799 | 1.7805 | 0 |
| 2026-10-20 | 0.0408 | -0.0172 | 0.0411 | -0.0505 | 1.1997 | 1.7996 | 0 |
| 2026-10-21 | 0.0406 | -0.0168 | 0.0308 | -0.041 | 1.1497 | 1.8913 | 0 |
| 2026-10-22 | 0.0397 | -0.0161 | 0.0313 | -0.0385 | 1.1471 | 1.8929 | 0 |
| 2026-10-23 | 0.0395 | -0.0154 | 0.0365 | -0.0462 | 1.2162 | 1.8245 | 0 |
Parameters
get_nelson_siegel_svensson accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
countries | list[str] | str | The countries, see get_zero_coupon_curve. Defaults to “United States”. | ["United States", "Germany"] |
period | str | Whether to fit the daily, weekly or monthly curves. Defaults to “daily”. | "weekly" |
svensson | bool | Whether to fit the Svensson model (True) or the Nelson-Siegel model (False). Defaults to True. | True |
maturities | list[float | str] | str | None | The maturities, in years or as labels such as “3M” and “10Y” (a list or a comma-separated string), to return the fitted zero-coupon yields at instead of the parameters. Defaults to None, which returns the parameters. | ["3M", "6M"] |
rounding | int | None | The number of decimals to round the results to. Defaults to None. | 2 |