duration: Return the duration of a bond-type object

Description Usage Arguments

View source: R/object_functions.R

Description

Return the duration of a bond or portfolio of bonds. Duration of cash is 0.

Usage

 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", ...)

Arguments

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.


gsk3/maRketSim documentation built on May 17, 2019, 8:55 a.m.