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

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


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

sigmai = [1 1.5 1];

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

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

end

Contact us