https://github.com/wilsonfreitas/copom
Term Structure Interpolation Considering Regulators Meetings
https://github.com/wilsonfreitas/copom
finance fixed-income term-structure-models
Last synced: 5 months ago
JSON representation
Term Structure Interpolation Considering Regulators Meetings
- Host: GitHub
- URL: https://github.com/wilsonfreitas/copom
- Owner: wilsonfreitas
- License: other
- Created: 2022-03-09T10:24:41.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-08T10:56:26.000Z (about 1 year ago)
- Last Synced: 2025-05-08T11:43:52.155Z (about 1 year ago)
- Topics: finance, fixed-income, term-structure-models
- Language: R
- Homepage: https://wilsonfreitas.github.io/copom/
- Size: 1.54 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# copom 
[](https://CRAN.R-project.org/package=copom)
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
The goal of copom is to interpolate term structures of interest rates taking into account the meetings where the regulators discuss
the changes on interest rates.
In Brazil these meetins are called COPOM and this interpolation considers
that the interest rate between COPOM meetings are flat, instead of being
flat betweet bonds maturities.
This is mainly for the short term of the term structure where
the interpolation is used to price private bonds and interest rate
derivatives.
## Installation
You can install the development version of copom from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("wilsonfreitas/copom")
```
## Example
```{r example}
library(bizdays)
library(fixedincome)
library(copom)
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")
plot(curve,
use_interpolation = TRUE, show_forward = TRUE,
legend_location = "bottomright"
)
```