interp_flatforwardcopom: FlatForwardCOPOM constructor

View source: R/flatforwardcopom-class.R

interp_flatforwardcopomR Documentation

FlatForwardCOPOM constructor

Description

'interp_flatforwardcopom' creates the Interpolation object.

Usage

interp_flatforwardcopom(copom_dates, conflicts)

Arguments

copom_dates

a vector of 'Date' objects.

conflicts

a character with one of: "forward", "second", "first", "optimize"

'copom_dates' is a vector with de dates of the meetings that must be considered in the interpolation.

'conflicts' specify how to deal with the conflicts that appear in the interpolation. These conflicts appear when two futures exist between two meeting. For one future between two meeting the decision is done, otherwise, the following alternatives are considered:

  • 'forward' used the forward rate between these two futures.

  • 'first' use the first future only.

  • 'second' use the second future only (this is suggested by Carreira and Brostowicz).

  • 'optimize' runs an optimization with the two futures.

Value

A 'FlatForwardCOPOM' object.

Examples

if (require(fixedincome) && require(bizdays)) {
  copom_dates <- as.Date(
    c("2022-03-17", "2022-05-05", "2022-06-17", "2022-08-04")
  )
  terms <- c(1, 3, 25, 44, 66, 87, 108, 131, 152, 172, 192, 214, 236, 277)
  rates <- c(
    0.1065, 0.1064, 0.111, 0.1138, 0.1168, 0.1189, 0.1207, 0.1219,
    0.1227, 0.1235, 0.1234, 0.1236, 0.1235, 0.1235
  )
  curve <- spotratecurve(
    rates, terms, "discrete", "business/252", "Brazil/ANBIMA",
    refdate = as.Date("2022-02-23")
  )
  interpolation(curve) <- interp_flatforwardcopom(copom_dates, "second")
}

wilsonfreitas/copom documentation built on June 11, 2025, 10:20 p.m.