How does this Nelson-Siegel functionwork?

4 次查看(过去 30 天)
Hi everyone,
I found this function on the Matlab website and although I kind of get the routine, I do not fully understand it to the point where I can explain it to someone else.
As far as I understand varargout(1) = {e'*e}; is estimated for all values of tau in the interval for which it is specified and the value of tau is returned based on the lowest value of varargout(1) = {e'*e};. Then least squares is performed using this found tau to estimate the Beta parameters.
I was wondering how this compares to the use of the lsqnonlin function. Below is the Nelson-Siegel function used.
Kind regards,
Michael

回答(1 个)

Roger Wohlwend
Roger Wohlwend 2014-7-1
The Nelson-Siegel function is non-linear. However, if you know the value of tau, then it is possible to estimate the betas with linear regression. That is what the function lsbetas does. You specify tau, then lsbetas performas linear regression and returns two variables: the coefficients (betas) and the sum of the squared residuals (e' * e). The first line of the function nelsonfit calls an optimizing function that searches for the value of tau that minimizes the sum of the squared residuals. The smaller the latter the better the fit.
You could also use the function lsqnonlin to estimate the betas and the tau. As the English say, there's more than one way to skin a cat.

类别

Help CenterFile Exchange 中查找有关 Financial Data 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by