Learn R Programming

RQuantLib (version 0.3.4)

ZeroPriceByYield: Zero Coupon Bond Theoretical Price evaluation

Description

The ZeroPriceYield function evaluates a zero-coupon clean price based on its yield.

Usage

## S3 method for class 'default':
ZeroPriceByYield(yield, faceAmount, 
                            issueDate, maturityDate, 
                            dayCounter=2, frequency=2, 
                            compound=0, businessDayConvention=4)
## S3 method for class 'Bond':
plotundefined
## S3 method for class 'Bond':
printundefined
## S3 method for class 'Bond':
summaryundefined

Arguments

yield
yield of the bond
faceAmount
face amount of the bond
issueDate
date the bond is issued
maturityDate
maturity date, an R's date type
dayCounter
day count convention. 0 = Actual360(), 1 = Actual365Fixed(), 2 = ActualActual(), 3 = Business252(), 4 = OneDayCounter(), 5 = SimpleDayCounter(), all other = Thirty360(). For more information, see QuantLib's DayCounter class
frequency
frequency of events,0=NoFrequency, 1=Once, 2=Annual, 3=Semiannual, 4=EveryFourthMonth, 5=Quarterly, 6=Bimonthly ,7=Monthly ,8=EveryFourthWeely,9=Biweekly, 10=Weekly, 11=Daily. For more information, see QuantLib's Frequency class
compound
compounding type. 0=Simple, 1=Compounded, 2=Continuous, all other=SimpleThenCompounded. See QuantLib's Compound class
businessDayConvention
convention used to adjust a date in case it is not a valid business day. See quantlib for more detail. 0 = Following, 1 = ModifiedFollowing, 2 = Preceding, 3 = ModifiedPreceding, other = Unadjusted

Value

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

References

http://quantlib.org for details on QuantLib. http://www.mathworks.com/access/helpdesk/help/toolbox/finfixed/zeroyield.html for more details about this function

Examples

Run this code
ZeroPriceByYield(0.1478, 100, as.Date("1993-6-24"), as.Date("1993-11-1"))

Run the code above in your browser using DataLab