View source: R/flatforwardcopom-class.R
interp_flatforwardcopom | R Documentation |
'interp_flatforwardcopom' creates the Interpolation object.
interp_flatforwardcopom(copom_dates, conflicts)
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:
|
A 'FlatForwardCOPOM' object.
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")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.