MATLAB: Does the Nelson–Siegel–Svensson model give me different parameters on different computers for the same data

fitsvenssonMATLAB

I am trying to fit the Nelson-Siegel-Svensson model to my data using the "fitSvensson" command, but I get different fitting parameters when I run the same code on different computers.
Why are these results not consistent and are there any steps I can take to ensure that I always get the same fitting parameters for my data?

Best Answer

Nelson-Siegel-Svensson model is particularly hard to fit to data, as multiple combinations of fitting parameters can result in models with a similar 'goodness of fit' to the data (see Gilli et al. "Calibrating the Nelson-Siegel-Svensson Model").
Fitting the Svensson model to data if fundamentally a nonlinear optimization problem and in this particular case very minor variations in how the optimal parameters are calculated can result in very different local optima being found. These variations can be as minor as differences in how computers store numbers in their memory.
The best way to limit variation in fitting parameters using the "fitSvensson" function is to specify tight bounds on the acceptable fitting parameters. This will force the solver to converge to a specific local optimum.