bond.price computes the price given the yield to maturity bond.duration computes the duration given the yield to maturity bond.yield computes the yield to maturity given the price bond.prices, bond.durations and bond.yields are wrapper functions that use mapply to vectorize bond.price, bond.duration and bond.yield All arguments to bond.prices, bond.durations and bond.yields can be vectors. On the other hand, bond.price, bond.duration and bond.yield do not allow vectors Standard compounding and day count conventions are supported for all functions.
bond.price(settle, mature, coupon, freq = 2, yield, convention = c("30/360",
"ACT/ACT", "ACT/360", "30/360E"), comp.freq = freq)bond.yield(settle, mature, coupon, freq = 2, price, convention = c("30/360",
"ACT/ACT", "ACT/360", "30/360E"), comp.freq = freq)
bond.duration(settle, mature, coupon, freq = 2, yield,
convention = c("30/360", "ACT/ACT", "ACT/360", "30/360E"),
modified = FALSE, comp.freq = freq)
bond.TCF(settle, mature, coupon, freq = 2, convention = c("30/360",
"ACT/ACT", "ACT/360", "30/360E"))
bond.prices(settle, mature, coupon, freq = 2, yield,
convention = c("30/360", "ACT/ACT", "ACT/360", "30/360E"),
comp.freq = freq)
bond.yields(settle, mature, coupon, freq = 2, price,
convention = c("30/360", "ACT/ACT", "ACT/360", "30/360E"),
comp.freq = freq)
bond.durations(settle, mature, coupon, freq = 2, yield,
convention = c("30/360", "ACT/ACT", "ACT/360", "30/360E"),
modified = FALSE, comp.freq = freq)
The settlement date for which the bond is traded. Can be a
character string or any object that can be converted into date using
as.Date.
The maturity date of the bond. Can be a character string or
any object that can be converted into date using as.Date
The coupon rate in decimal (0.10 or 10e-2 for 10%)
The frequency of coupon payments: 1 for annual, 2 for semi-annual, 12 for monthly.
The yield to maturity of the bond
The daycount convention
The frequency of compounding of the bond yield: 1 for annual, 2 for semi-annual, 12 for monthly. Usually same as freq.
The clean price of the bond.
A logical value used in duration. TRUE to return Modified
Duration, FALSE otherwise
bond.TCF returns a list of three components
A vector of cash flow dates in number of years
A vector of cash flows
The accrued interest