Description Usage Arguments Examples
View source: R/BondFunctions.R
This is generic function to determine the price of a bond given the yield to maturity (YTM). It is a nominal example of pricing a bond given its yield to maturity. The equation assumes pricing from one payment date to the next. It does not account for acrrued interest.
1 2 3 4 5 6 7 |
yield.to.maturity |
A numeric value expressing the yield to maturity (discount rate) as an annual percentage. |
coupon |
A numeric value the coupon paid by the bond as a percentage of the bond's principal amount |
coupon.frequency |
A numeirc value expressing the frequency of payments over one year |
years.mat |
A numeric value expressing the years to maturity |
face.value |
A numeric value expressing the face value (principal amount) of the bond |
1 2 3 | bondprice(
yield.to.maturity = .05, coupon = .05, coupon.frequency = 2,
years.mat = 10, face.value = 100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.