RcmdrPlugin.RiskDemo (version 1.9)

bondFigure: Bond price as a function of interest rate.

Description

This function plots the bond price as a function of interest rate. It also shows, using dotted lines, the yield to maturity rate corresponding to the face value, and the flat price corresponding to the yield to maturity.

Usage

bondFigure(buyDate, matDate, rateCoupon, yieldToMat = NULL, bondPr = NULL, nPay)

Arguments

buyDate

the date when the coupon is bought (settlement date)

matDate

maturity date

rateCoupon

coupon rate (in decimals)

yieldToMat

yield to maturity (in decimals)

bondPr

the flat price of the bond

nPay

number of coupon payments per year

Value

This function only plots a figure.

Details

either yieldToMat or bondPr should be given as input.

References

Bodie, Kane, and Marcus (2014) Investments, 10th Global Edition, McGraw-Hill Education, (see Section 14.2 Bond Pricing).

See Also

bondPrice, solveYield

Examples

Run this code
# NOT RUN {
bondFigure("2012-7-31","2018-7-31",rateCoupon=0.0225,yieldToMat=0.0079,nPay=2)
bondFigure("2012-7-31","2018-7-31",rateCoupon=0.0225,bondPr=90,nPay=2)
# }

Run the code above in your browser using DataCamp Workspace