Package: fBonds

Yohan Chalabi chalabi at
Wed Sep 23 00:09:38 CEST 2009

>>>> "SG" == "Sergio Guirreri" <sergioguirreri at>
>>>> on Sun, 26 Jul 2009 17:16:06 +0200

   SG> I'm using the package fBonds to estimate the yield curve
   SG> by Nelson
   SG> Siegel's method. I'm focusing on the code of the function
   SG> NelsonSiegel
   SG> and I note that could be a problem:
   SG> 1)
   SG> the graphic of the yield curve is done with the vector of
   SG> the starting
   SG> parameter and not whit the estimated parameters. I report the
   SG> piece of
   SG> code:
   SG>	fit = nlminb(start = gvec, objective = func, rate = rate,
   SG> maturity = maturity, control = list(eval.max = 2000,
   SG> iter.max = 2000))
   SG>	names(fit) = c(beta0, beta1, beta2, tau1)
   SG>	if (doplot) {
   SG> ---->>> yfit = fx(maturity, gvec)
   SG> ---->>> plot(maturity, rate, ylim = c(min(c(rate, yfit)),
   SG> max(c(rate,
   SG> yfit))), main = Nelson-Siegel)
   SG> ---->>> lines(maturity, yfit, col = steelblue)
   SG> grid()
   SG> the object yfit contains the interest rates estimated with
   SG> the vector
   SG> gvec which is the starting parameter, while the estimated
   SG> coefficients
   SG> are in the object fit.
   SG> Could the same problem be in the function Svensson ?
   SG> Best regards Sergio Guirreri

Hi Sergio,

Thanks for the report. I changed the code in fBonds.


PhD student
Swiss Federal Institute of Technology

More information about the Rmetrics-core mailing list