Parameter restrictions for Nelson-Siegel yield curve in quantlib
<p>I am using QL in Python and have translated parts of the example file
<a href="http://quantlib.org/reference/_fitted_bond_curve_8cpp-example.html#_a25" rel="nofollow">http://quantlib.org/reference/_fitted_bond_curve_8cpp-example.html#_a25</a>;
of how to fit a yield curve with bonds in order to fit a Nelson-Siegel
yield curve to a set of given calibration bonds.</p>

<p>As usual when performing such a non-linear fit, the results depend strongly
on the initial conditions and many (economically meaningless) minima of the
objective function exist. This is why putting constraints on the parameters
is essential for success. To give an example, at times I get negative
tau/lambda parameters and my yield curve diverges.</p>

<p>I did not find how these parameter constraints can be specified in
the NelsonSiegelFitting or the FittedBondDiscountCurve classes. I could
imagine that anyone performing NS fitting in QL will encounter the same
issue.</p>