Yield Curve - Nelson Siegel

Overview


Nelson and Siegel proposed a simple formula that is capable of fitting various forms of the yield curve. It can be used to provide interpolations between periods on the curve, as well as to decompose movements of the curve to a small set of factors.

Yield Curve Formula


The Nelson Siegel Model assumes the following functional form for the zero coupon rates
{% r(t) = \beta_0 + \beta_1 \frac{1 - e^{t/\tau}}{t/\tau} + \beta_2 (\frac{1-e^{t/\tau}}{t/\tau} - e^{t/\tau}) %}
  • level - labeled as {% \beta_0 %} above
  • slope - labeled as {% \beta_1 %} above
  • shape - labeled as {% \beta_2 %} above
  • decay - labeled as {% \tau %}, sometimes the formula is written with {% \lambda = \frac{1}{\tau} %} above

Chart


The following code implements the Nelson Siegel function. It is coded as a function that takes the given parameters and returns a function of time, which can be used to chart the curve.


let getCurve = function(level, slope, shape, decay,t){
    return function(t){
        let factor1 = level;
        let factor2 = slope * (1 - Math.exp(-1*t/decay))/(t/decay)
        let factor3 = shape * ((1 - Math.exp(-1*t/decay))/(t/decay)-Math.exp(-1*t/decay))
        return factor1+factor2+factor3;
    }
}
					

Chart


Fitting to Data


The Nelson Siegel model is nonlinear, and hence cannot be estimated using a linear regression. The typical way to fit the paramters to data is to use some form of numeric optimization.

For an example demonstration of fitting the curve, please see fitting a yield curve