Learn R Programming

creditr (version 0.6.1)

add_dates: Return CDS dates.

Description

add_dates takes a data frame which contains dates, tenor (or maturity) and currency and returns appropriate dates for pricing a CDS contract.

Usage

add_dates(x, date.var = "date", maturity.var = "maturity",
  tenor.var = "tenor", currency.var = "currency")

Arguments

x
a data frame, containing all necessary information
date.var
character, column name of date variable
maturity.var
character, column name of maturity variable
tenor.var
character, column name of tenor variable
currency.var
character, column name of currency variable

Value

  • a date frame containing all the input columns, as well as eight more columns: stepinDate (T+1), valueDate (T+3 business days), startDate (accrual begin date), endDate (maturity), backstopDate (T-60 day look back from which 'protection' is effective), firstcouponDate (the date on which the first coupon is paid), pencouponDate (second to last coupon date), and baseDate (the starting date for the IR curve)

References

http://www.cdsmodel.com/cdsmodel/assets/cds-model/docs/c-code http://www.cdsmodel.com/assets/cds-model/docs/Standard

Examples

Run this code
x <- data.frame(date = c(as.Date("2014-05-06"), as.Date("2014-05-07")),
                tenor = rep(5, 2), currency = c("JPY", "USD"))
add_dates(x)

Run the code above in your browser using DataLab