Forecasting the Yield Curve


Does somebody knows if Diebold and Li model ( which allows to recast the term structure of interest rates has been implemented in Gauss by somebody and the code is available?



1 Answer


Dear Miguel,

I do not know of any GAUSS code implementing the yield code prediction methodology presented by Diebold and Li (2006). However, the simple example and procedure below will allow you to estimate the factor loadings β1t, β2t, and β3t from yield curve data. The procedure is based on the least squares methodology outlined in section 3.2 of the paper cited in your original question.

//Data should be stored as a K x T matrix
//Each column represents a month and each row represents
//yield for a given maturity at that month

//User specified lambda
lambda = .0609;

//Vector of observed maturities
TimeToMat = {3,6,9,24,36,60,84,120,240,360};

//Read data from .xls file
yields = xlsReadM("examples\\dailyTreasuryYields.xlsx","b2",1,"");

//Call procedure to estimated betas
bta = findBetaDieboldLi(yields/100,lambda,TimeToMat);

//This defines the procedure which estimates the factor loading
proc(1) = findBetaDieboldLi(y,lambda,timeToMaturity);
   local x,bta,numMaturities,numMonths;

   numMaturities = rows(y);
   numMonths = cols(y);

   x = ones(numMaturities,1)~(1-exp(-lambda*timeToMaturity)./(lambda*time   ToMaturity))~((1-exp(-lambda*timeToMaturity)./(lambda*timeToMaturity))   -exp(-lambda*timeToMaturity));

   bta = y/x;


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy