Learn R Programming

RQuantLib (version 0.3.2)

ConvertibleFloatingCouponBond: Convertible Floating Coupon Bond evaluation

Description

The ConvertibleFloatingCouponBond function setups and evaluates a ConvertibleFixedCouponBond using QuantLib's BinomialConvertibleEngine http://quantlib.org/reference/class_quant_lib_1_1_binomial_convertible_engine.html and BlackScholesMertonProcess http://quantlib.org/reference/class_quant_lib_1_1_black_scholes_merton_process.html. The NPV, clean price, dirty price, accrued interest, yield and cash flows of the bond is returned. For detail, see test-suite/convertiblebond.cpp

Usage

## S3 method for class 'default':
ConvertibleFloatingCouponBond(bondparams, iborindex, spread, process, dateparams)
## S3 method for class 'Bond':
plotundefined
## S3 method for class 'Bond':
printundefined
## S3 method for class 'Bond':
summaryundefined

Arguments

bondparams
bond parameters: ll{ exercuse a string, either "eu" for European option, or "am" for American option. faceAmount a double, face amount of the bond issueDate a Date, the bond's issu
iborindex
a DiscountCurve object, represents an IborIndex
spread
a double vector, represents paramter 'spreads' in ConvertibleFloatingBond's constructor.
process
arguments to construct a BlackScholes process and set up the binomial pricing engine for this bond. ll{ underlying a double, flat underlying term structure volatility a double, flat volatility term str
dateparams
QuantLib's date parameters of the bond. ll{ settlementDays a double, settlement days. calendar a string, either 'us' or 'uk' corresponding to US Goverment Bond calendar and UK Exchange calendar.

Value

  • The ConvertibleFloatingCouponBond function returns an object of class ConvertibleFloatingCouponBond (which inherits from class Bond). It contains a list with the following components:
  • NPVnet present value of the bond
  • cleanPriceprice price of the bond
  • dirtyPricedirty price of the bond
  • accruedAmountaccrued amount of the bond
  • yieldyield of the bond
  • cashFlowscash flows of the bond

Details

Please see any decent Finance textbook for background reading, and the QuantLib documentation for details on the QuantLib implementation.

References

http://quantlib.org/reference/class_quant_lib_1_1_convertible_zero_coupon_bond.html

Examples

Run this code
#this follow an example in test-suite/convertiblebond.cpp for ConvertibleZeroCouponBond
params <- list(tradeDate=Sys.Date()-2,
               settleDate=Sys.Date(),
               dt=.25,
               interpWhat="discount",
               interpHow="loglinear")
times <- seq(0,10,.1)


dividendYield <- DiscountCurve(params, list(flat=0.02), times)
riskFreeRate <- DiscountCurve(params, list(flat=0.05), times)

dividendSchedule <- data.frame(Type=character(0), Amount=numeric(0),
                            Rate = numeric(0), Date = as.Date(character(0)))
callabilitySchedule <- data.frame(Price = numeric(0), Type=character(0),
                          Date = as.Date(character(0)))

process <- list(underlying=50, divYield = dividendYield,
                rff = riskFreeRate, volatility=0.15)

today <- Sys.Date()
bondparams <- list(exercise="am", faceAmount=100, divSch = dividendSchedule, 
                   callSch = callabilitySchedule, redemption=100, 
                   creditSpread=0.005, conversionRatio = 0.0000000001, 
                   issueDate=as.Date(today+2), 
                   maturityDate=as.Date(today+3650))
dateparams <- list(settlementDays=3, 
                   dayCounter="Actual360", 
                   period = "Once", calendar = "us", 
                   businessDayConvention="Following", 
                   todayDate=as.Date(today))

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 )
curvedateparams <- list(settlementDays=0, period="Annual", 
                   dayCounter="SimpleDayCounter", 
                  businessDayConvention ="Unadjusted")
curveparams <- list(method="ExponentialSplinesFitting", 
                    origDate = Sys.Date())
curve <- FittedBondCurve(curveparams, lengths, coupons, curvedateparams)
iborindex <- list(type="USDLibor", length=6, 
                  inTermOf="Month", term=curve)   
spreads <- c()
ConvertibleFloatingCouponBond(bondparams, iborindex,spreads, process, dateparams)

Run the code above in your browser using DataLab