| duration | R Documentation |
durationFunction which calculates the duration of a portfolio or a contract.
duration(x, type="macaulay", yield, price, isPercentage=TRUE, from)
x |
the contract or portfolio of contracts for which to calculate the duration. |
type |
a |
yield |
a |
price |
a |
isPercentage |
a |
from |
a |
For the Macaulay duration, if yield is not provided, price should
be provided and is used to calculate the yield.
For the Fisher-Weil duration, yieldCurve must be specified. In this
case the argument price has no effect.
a numeic containing the calculated duration.
bnd1=bond(start="2015-01-01", maturity="30 years", nominal=1000,
coupon=0.06, couponFreq="1 year", role="long", variable=FALSE)
duration(bnd1, type="macaulay", yield=9)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.