fit_interpolation-COPOMScenarios-SpotRateCurve-method.Rd
Finds the COPOM moves (or future rates) that yields the least interpolation error.
# S4 method for COPOMScenarios,SpotRateCurve
fit_interpolation(object, x, ...)
a COPOMScenarios object with initial parameters set.
a SpotRateCurve object.
additional arguments. Currently unused.
A `Interpolation` object.
if (FALSE) {
library(fixedincome)
library(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")
)
cd <- get_copom_dates(curve@refdate, 4)
cm <- c(50, 25, 0, 0) / 1e4
interpolation(curve) <- fit_interpolation(
interp_copomscenarios(cd, cm),
curve
)
}