Code covered by the BSD License  

Highlights from
Navigating curves

image thumbnail

Navigating curves

by

 

Developing Scenario Analysis Applications using Interest Rate Curve Objects in MATLAB

getNewNelsonsiegelParams(oldParams, t)
function [newParams] = getNewNelsonsiegelParams(oldParams, t)
%getNewNelsonsiegelParams Helper function that returns new NelsonSeigel
%parameters
%   --------------------------------------------------------------------------
%   Author: Sri Krishnamurthy,CFA
%   Contact: skrishna@mathworks.com
%   Copyright 1984-2013 The MathWorks, Inc.


mu = 0;
sigma = 1;
rho = 0.03;

sigmai = [.02 .025 0.02];

covMatrix = [sigma^2,rho*sigma*sigma;rho*sigma*sigma,sigma^2];
X = [randn mvnrnd([0,0],covMatrix)];

newParams = [oldParams(1:end-1)*t + sigmai.*X oldParams(end)];

end

Contact us