[R-SIG-Finance] RquantLib : FittedBondCurve function

Olivier Schmitt olivier.schmitt at gmail.com
Thu Nov 5 00:33:20 CET 2009


Hi,

I am trying to run an example based on the one provided in the
documentation for FittedBondCurve, from RQuantLib but using current
data.


> library(RQuantLib)
Loading required package: Rcpp
> lengths <- c(2,5,7,10,30)
> coupons<- c(0.0090,0.024,0.03,0.035,0.043)
> dateparams <- list(settlementDays=0, period="Annual", dayCounter="SimpleDayCounter", businessDayConvention ="Unadjusted")
> curveparams <- list(method="ExponentialSplinesFitting", origDate = Sys.Date())
> curve <- FittedBondCurve(curveparams, lengths, coupons, dateparams)
>
> curve$table[2*365,]
          date  zeroRates  discount
730 2011-11-03 0.02553986 0.9502694
> curve$table[5*365,]
           date  zeroRates  discount
1825 2014-11-02 0.02658928 0.8756396

So, it seems the output curve does not fit the short end data very
well. Are there further parameters that I could adjust to improve
this?

Thanks!

Olivier



More information about the R-SIG-Finance mailing list