matlab - Nelson - Siegel Model -


i working on yield curve (nelson - siegel model) in matlab. problem accurency of evaluation parameters isn't enough.

my code:-

x=[1/12, 3/12, 6/12 ] ;    % xdata y =[3.66, 4.26, 4.39 ] ;   % ydata  x=[0, 0, 0, 0]; % vector coefficients  x0 = [1 ,1, 1, 1 ];  %initial values beta1 , beta2, beta3, lambda  modelfun  = @(x,x)  (  x(1) + (x(1) + x(2)) * x(4) * (( 1 - exp(-x/x(4)))/x) - x(3) * exp(-x/x(4))  ) ;  [x,resnorm,~,exitflag,output] = lsqcurvefit(modelfun,x0,x,y) 

i need more accurate evaluation coefficients. have read somewhere should fix lambda parameter first fminsearch function , estimate betas parameters, don't know how implement in matlab. ask how should fix initial values?


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -