fmbasics (version 0.3.0)

indexshifters: Index date shifters

Description

A collection of methods that shift dates according to index conventions.

Usage

to_reset(dates, index)

to_value(dates, index)

to_maturity(dates, index)

# S3 method for default to_reset(dates, index)

# S3 method for default to_value(dates, index)

# S3 method for default to_maturity(dates, index)

Arguments

dates

a vector of dates to shift

index

an instance of an object that inherits from the Index class.

Value

a vector of shifted dates

Details

The following describes the default methods. to_reset() treats the input dates as value dates and shifts these to the corresponding reset or fixing dates using the index's spot lag; to_value() treats the input dates as reset or fixing dates and shifts them to the corresponding value dates using the index's spot lag; and to_maturity() treats the input dates as value dates and shifts these to the index's corresponding maturity date using the index's tenor.

Examples

Run this code
# NOT RUN {
library(lubridate)
to_reset(ymd(20170101) + days(0:30), AUDBBSW(months(3)))
to_value(ymd(20170101) + days(0:30), AUDBBSW(months(3)))
to_maturity(ymd(20170101) + days(0:30), AUDBBSW(months(3)))
# }

Run the code above in your browser using DataLab