Olivier:
 
I've never used Rquantlib but the key to note for the underlying QuantLib code is that it is based on a multidimensional optimization problem- the mathematical solutions you get (and there may be multiple solutions to the problem- nonuniqueness here) may very well depend on where you inititalize your search (guessSolution_ in the code below).
 
http://quantlib.svn.sourceforge.net/viewvc/quantlib/trunk/QuantLib/ql/termstructures/yield/fittedbonddiscountcurve.cpp?revision=16281&view=markup
 
There are also iteration numbers and lamda parameters to play with in the original code. You can even change the optimization method if you have the time.
 
Generally, that two year point will get you a kink in the curve since it is more out of line with the other coupons. Since you are minimizing pricing errors subject to a duration adjustment (gives you approximately yield), my guess is a single outlier is probably never going to be fit well with this generic methodology. To pull the curve down closer to this point, you may have to artificially add other points close to this bond, with a similar coupon. Then the optimization will weight this part of the curve more (but now, to the possible detriment of other points on the curve....). 
 
Generally, best fitting from 2 to 30 years accurately will not be easy- this is a global best fit, which may lead to local issues. May also consider just fitting 0-10 years separately from the longer tenors (10-30 years). For fair value pricing purposes, this may be a better bet.
 
Finally, note also you're comparing zero rates to the coupons (I think). This may not be the best comparison. Par rates should come closer to the coupons.
 
Best,
Allen


--- On Wed, 11/4/09, Olivier Schmitt <olivier.schmitt@gmail.com> wrote:


From: Olivier Schmitt <olivier.schmitt@gmail.com>
Subject: [R-SIG-Finance] RquantLib : FittedBondCurve function
To: r-sig-finance@stat.math.ethz.ch
Date: Wednesday, November 4, 2009, 6:33 PM


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

_______________________________________________
R-SIG-Finance@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.



      
	[[alternative HTML version deleted]]

