ConvertibleFloatingCouponBond {RQuantLib}R Documentation

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

## Default S3 method:
ConvertibleFloatingCouponBond(bondparams, iborindex, spread, process, dateparams)
## S3 method for class 'Bond':
plot
## S3 method for class 'Bond':
print
## S3 method for class 'Bond':
summary

Arguments

bondparams bond parameters:
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 issue date
maturityDate a Date, the bond's maturity date
redemption a double, percentage of the initial face amount that will be returned at maturity date. Normally set at 100
dividendSchedule a data frame whose columns are "Type", "Amount", "Rate", and "Date" corresponding to QuantLib's DividendSchedule
callabilitySchedule a data frame whose columns are "Price", "Type" and "Date" corresponding to QuantLib's CallabilitySchedule
creditSpread a double, credit spread parameter in the constructor of the bond.
conversitionRatio a double, conversition ratio parameter in the constructor of the bond.
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.
underlying a double, flat underlying term structure
volatility a double, flat volatility term structure
dividendYield a DiscountCurve object
riskFreeRate a DiscountCurve object
dateparams QuantLib's date parameters of the bond.
settlementDays a double, settlement days.
calendar a string, either 'us' or 'uk' corresponding to US Goverment Bond calendar and UK Exchange calendar.
dayCounter a number or string, day counter convention. See Enum
period a number or string, interest compounding interval. See Enum
businessDayConvention a number or string, business day convention. See Enum
todayDate a date, date of today.
See example below.

Details

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

Value

The ConvertibleFloatingCouponBond function returns an object of class ConvertibleFloatingCouponBond (which inherits from class Bond). It contains a list with the following components:

NPV net present value of the bond
cleanPrice price price of the bond
dirtyPrice dirty price of the bond
accruedAmount accrued amount of the bond
yield yield of the bond
cashFlows cash flows of the bond

Author(s)

Khanh Nguyen knguyen@cs.umb.edu for the inplementation; Dirk Eddelbuettel edd@debian.org for the R interface; the QuantLib Group for QuantLib

References

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

Examples

#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)


[Package RQuantLib version 0.3.2 Index]