FittedBondCurve {RQuantLib} | R Documentation |
FittedBondCurve
fits a term structure to a set of bonds
using three different fitting methodologies. For more detail,
see QuantLib/Example/FittedBondCurve.
FittedBondCurve(curveparams, lengths, coupons, dateparams)
curveparams |
curve parameters
| ||||||||
lengths |
an integer vector, length of the bonds in year | ||||||||
coupons |
a double vector, coupon rate of the bonds | ||||||||
dateparams |
QuantLib's date parameters.
|
Please see any decent Finance textbook for background reading, and the
QuantLib
documentation for details on the QuantLib
implementation.
table
, a three columns "date - zeroRate - discount" data frame
Khanh Nguyen knguyen@cs.umb.edu for the inplementation; Dirk Eddelbuettel edd@debian.org for the R interface;
the QuantLib Group for QuantLib
http://quantlib.org/reference/class_quant_lib_1_1_fitted_bond_discount_curve.html
lengths <- c(2,4,6,8,10,12,14,16,18,20,22,24,26,28,30) coupons <- c( 0.0200, 0.0225, 0.0250, 0.0275, 0.0300, 0.0325, 0.0350, 0.0375, 0.0400, 0.0425, 0.0450, 0.0475, 0.0500, 0.0525, 0.0550 ) dateparams <- list(settlementDays=0, period="Annual", dayCounter="SimpleDayCounter", businessDayConvention ="Unadjusted") curveparams <- list(method="ExponentialSplinesFitting", origDate = Sys.Date()) curve <- FittedBondCurve(curveparams, lengths, coupons, dateparams) library(zoo) z <- zoo(curve$table$zeroRates, order.by=curve$table$date) plot(z)