generate_schedule {fmdates} | R Documentation |
Generate a date schedule
Description
Generate a date schedule from effective_date
to
termination_date
. This code was derived from the Quantlib method
Schedule::Schedule. This can be used to generate the cash flow, fixing and
projection dates of an interest rate swap according to certain conventions.
Usage
generate_schedule(effective_date, termination_date, tenor,
calendar = EmptyCalendar(), bdc = "u", stub = "short_front",
eom_rule = FALSE, first_date = effective_date,
last_date = termination_date)
Arguments
effective_date |
the date at which the schedule begins. For example, the
effective date of a swap. This should be |
termination_date |
the date at which the schedule ends. For example, the
termination date of a swap. This should be |
tenor |
the frequency of the events for which dates are generated. For
example, |
calendar |
a |
bdc |
a string representing one of the following business day conventions: "u", "f", "mf", "p", "mp", "ms" (unadjusted, following, modified following, preceding, modified preceding and modified succeeding, resp.) |
stub |
a string representing one of the following stub types: "short_front", "short_back", "long_front", "long_back". |
eom_rule |
a logical value defining whether the end-to-end convention applies. |
first_date |
date of first payment for example. This defaults to
|
last_date |
date of last payment for example. This defaults to
|
Value
an Interval
vector
See Also
Other calendar methods: adjust
,
is_good
, is_valid_bdc
,
is
, locale
,
shift
, tz
Examples
library (lubridate)
effective_date <- ymd('20120103')
termination_date <- ymd('20121203')
tenor <- months(3)
stub <- 'short_front'
bdc <- 'mf'
calendar <- AUSYCalendar()
eom_rule <- FALSE
generate_schedule(effective_date, termination_date, tenor, calendar,
bdc, stub, eom_rule)