View source: R/object_functions.R
Return the duration of a bond or portfolio of bonds. Duration of cash is 0.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | duration(x, type = "modified", ...)
## Default S3 method:
duration(x, type="modified", mkt, ...)
## S3 method for class 'cash'
duration(x, type="modified", mkt, ...)
## S3 method for class 'bond'
duration(x, type="modified", mkt, ...)
## S3 method for class 'portfolio.bond'
duration(x, type="modified", mkt, ...)
## S3 method for class 'account'
duration(x, type="modified", mkt, ...)
## S3 method for class 'history.account'
duration(x, type = "modified", ...)
## S3 method for class 'sum.account'
duration(x, type = "modified", ...)
|
x |
A relevant maRketSim object (bond, portfolio.bond, etc.) |
mkt |
A market object under whose interest rate you want to find the duration. |
type |
Currently only option is "modified", where it returns the modified MacAulay duration |
... |
Pass-alongs. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.