ConvertibleZeroCouponBond {RQuantLib} | R Documentation |
Convertible Zero Coupon Bond evaluation
Description
The ConvertibleZeroCouponBond
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:
ConvertibleZeroCouponBond(bondparams, 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. |
|
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 ConvertibleZeroCouponBond
function returns an object of class
ConvertibleZeroCouponBond
(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))
ConvertibleZeroCouponBond(bondparams, process, dateparams)
[Package
RQuantLib version 0.3.2
Index]