Skip to content
All library documents

Initializing Nelson–Siegel–Svensson Curve Fitting

Article Quant Q&A · Author: Jojo

Summary

The document addresses how to initialize a nonlinear fit of Nelson–Siegel–Svensson parameters to observed government bond prices. Its suggested procedure is to fix the decay parameter, estimate the remaining coefficients with ordinary least squares, and repeat across a range of decay values. Comparing squared errors across these fits gives candidate starting parameters for a subsequent nonlinear optimization.

The response distinguishes the Nelson–Siegel model, which permits one hump, from the Svensson extension, which can represent two. The proposed grid search is a practical way to reduce sensitivity to initial guesses, but it does not guarantee a global optimum or resolve model specification, constraints, or data-quality issues. The answer describes an estimation workflow rather than reporting a fitted curve or evidence from a particular GBP bond sample.

Key ideas

  • The Svensson extension adds flexibility to the original Nelson–Siegel curve and can represent an additional hump.
  • Fixing the decay parameter allows the other coefficients to be estimated by ordinary least squares.
  • Repeating the fit over a range of decay values helps identify promising initial parameters by squared error.
  • A nonlinear optimizer can then refine the candidate parameters, though the approach does not guarantee a global solution.

Tags

Full text
# Setting input parameters for Nelson Siegel Svensson model


# Setting input parameters for Nelson Siegel Svensson model












I am trying to determine the parameters for the Nelson Siegel Svensson model and am solving a Non-Linear Optimization problem to do this.

I am trying to solve:

$$ \min_\theta{\sum{(p_i - \hat p_i)^2}}. $$

where $p_i$ are the observed dirty prices of the bonds and $\hat p_i$ are the prices that have been calculated using the NSS parameters, $\theta$

I am using the procedure presented in this paper. But I've also read that the Optimization is highly sensitive to the input set of parameters ($\theta$) as mentioned in Page 2 of this paper. Hence, if I don't have data on these parameters how should I look to set the input. I am currently trying to do this for GBP Government Bonds, but am unable to find any published parameters. I was also unable to find how people circumvent this problem.

Currently, I am using the $\theta$ values presented here as I thought they may be similar for the GBP Government Bonds. However, the Optimization proves to be unsolvable.

This is part of the code that I am using in Python to solve the optimization problem. `func` just returns the sum of the squared difference in prices (Objective function) and `params` refer to $\theta$. These are the input `params` I am currently using.

```
params = [3.15698855,    -2.98240445,    -3.37586632,    -1.67713694,    0.88538977,    3.84324841] #Theta
optimize.minimize(func, params, method='COBYLA', constraints = cons, options={'disp': True})
```

Thank You

## Answer by phdstudent (score 3, accepted)

https://quant.stackexchange.com/a/19004

Jojo, once again the paper is about Nelson-Siegel and not Nelson-Siegel svensson (the former allows for one hump whereas the latter for two humps).

Jojo, in practice people often start by fixing $\lambda$ then estimate the model by OLS and check the squared errors of the model. Then change $\lambda$ and repeat the procedure. This is highly efficient, and you can do it for a reasonable large range for $\lambda$. Then check which $\lambda$ yields the lowest squared errors. This should not take more than 30 seconds in a standard computer.

Then do the optimization algorithm setting as initial parameters the ones obtained using the procedure outlined before. The should move (hopefully not much), and reduce the squared errors.

This is almost equivalent to a simulation annealing technique.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.