---
title: "yrnd_functions"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{yrnd_functions}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
library(yrnd)
```

```{r setup}
library(yrnd)
```

## yrnd

The package '"yrnd"' estimates a parametric form of the risk neutral distribution of prices of fixed-income futures such as Short Term Interest Rates futures and sovereign bond futures, using options written on those futures. This is the distribution at options' maturity. The package also provides the distribution of rates and bond yields themselves at options' maturity, starting from the density of the futures price. It provides with some statistics of the distribution as well as a density and a cumulative density plot.

## Getting the risk neutral density of the yield to maturity of a futures contract's Cheapest-to-Deliver Bond from options on the bond future

```{r}
ctd_bond_yield(c(10.39,9.92,9.46,9.00,8.55,8.10,7.66,7.23,
6.81,6.39,5.98,5.58,5.20,4.82,4.46,4.10,3.76,3.44,3.13,2.83,2.56,
2.29,2.05,1.82,1.61,1.42,1.25,1.09,0.95,0.82,0.71,0.61,0.53,0.45,
0.38,0.33,0.28,0.23,0.20,0.17,0.14,0.12,0.10,0.08), seq(106, 127.5, 0.5),
c(0.22,0.25,0.29,0.33,0.38,0.43,0.49,0.56,0.64,0.72,0.81,0.91,
1.03,1.15,1.29, 1.43,1.59,1.77,1.96,2.16,2.39,2.62,2.88,3.15,
3.44,3.75,4.08, 4.42,4.78,5.15,5.54,5.94,6.36,6.78,7.21,7.66,
8.11,8.56,9.03, 9.50,9.97,10.45,10.93,11.41), seq(106, 127.5, 0.5),
2, 0.0344, 0.035, 1, 3, 0.893, 0.0435, as.Date("2033-11-01"), 0.5, 100,
2, 116.17, as.Date("2024-12-10"), as.Date("2024-11-22"), as.Date("2024-06-14"),
"Italian", "EUR")
```
