Description Usage Arguments Value Author(s) Examples
Estimate the macaulay or modified duration of a fixed rate coupon bond given the discount curve and bond data. The duration is calculated using the continuously compounded yield
1 2 | bondDuration(bond, discountCurve, percentChangeYield = 0,
type = c("modified", "macaulay"))
|
bond |
a |
discountCurve |
vector of discount rates |
percentChangeYield |
optional elasticity measure |
type |
specify modified or macaulay duration |
duration of the bond
Thomas Fillebeen and Jaiganesh Prabhakaran
1 2 3 4 5 | time = seq(from=0.5, to=2, by=0.5)
DF = rbind(0.968,0.9407242,0.9031545,0.8739803)
bond = bondSpec(time, face=100, m=2, couponRate = 0.0475)
mcDuration = bondDuration(bond,DF, type="macaulay")
modDuration = bondDuration(bond,DF, type="modified")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.