| Title: | Extracts Risk Neutral Densities of Prices, Money Market Rates and Government Bond Yields from Interest Rates Futures Options Prices |
| Version: | 0.1.5 |
| Description: | Provides with parametric Risk Neutral Densities (RNDs) and cumulative densities of futures prices on fixed-income products. It relies on options on Short Term Interest Rate futures or options on government bond futures. It models the futures price as a mixture of lognormal densities. It also provides with the RNDs and cumulative densities of the money market rate or the government bond yield inferred from the futures price, using the RND of the futures price. The package also provides with the probability attached to each bond in the delivery basket of a government bond futures to be the cheapest at maturity, and also the non parametric distribution of the spread between two bond yields, using two RNDs based on options on bond futures of the same maturity. The package leverages on the works of Melick, W. R. and Thomas, C. P. (1997) <doi:10.2307/2331318> and B. Bahra (1998) <doi:10.2139/ssrn.77429>. |
| License: | GPL-3 |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| Imports: | dplyr, ggplot2, lubridate, MASS, Rblpapi, scales, stats, tibble, tvm, utils, zoo |
| Suggests: | knitr, rmarkdown |
| VignetteBuilder: | knitr |
| NeedsCompilation: | no |
| Packaged: | 2026-07-21 17:32:47 UTC; William |
| Author: | William Arrata [aut, cre] |
| Maintainer: | William Arrata <william.arrata@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-07-21 19:30:02 UTC |
bond_future_charac_bbg
Description
bond_future_charac_bbg
Usage
bond_future_charac_bbg(bbg_tickers)
Arguments
bbg_tickers |
a vector of Bloomberg tickers of bond futures contracts, in character format |
Value
for each bond futures contract, its maturity date in Date format, its currency, its listing place and its underlying asset all in character format.
Examples
## Not run:
bond_future_charac_bbg(c("TYU24", "CNM6", "KAAH6", "IKM6", "OATU6"))
## End(Not run)
bond_future_price
Description
bond_future_price
Usage
bond_future_price(
call_prices,
call_strikes,
put_prices,
put_strikes,
nb_log,
r,
day_count_conv,
cot,
ctd_matu,
fut_price,
fut_matu,
option_matu,
start_date,
nationality = NA,
currency = NA
)
Arguments
call_prices |
a vector of call prices on a bond futures, in numeric format |
call_strikes |
a vector of call strikes attached to the call prices, in numeric format |
put_prices |
a vector of put prices on a bond futures, in numeric format |
put_strikes |
a vector of put strikes attached to the put prices, in numeric format |
nb_log |
a number for the number of component densities in the lognormal mixture to model the bond futures' price, either 2 or 3, in numeric format |
r |
a number for the riskfree spot rate whose maturity is equal to the options' maturity, in numeric format |
day_count_conv |
a number for the day count convention, 1 for ACT/ACT, 2 for ACT/360, 3 for ACT/365 and 4 for 30/360, in numeric format |
cot |
a number for the options' style, 1 for European options, 2 for American options and 3 for American options with futures-style margin, in numeric format |
ctd_matu |
a date for the maturity date of the current Cheapest-to-Deliver Bond of the bond futures, in Date format |
fut_price |
a number for the bond futures' price on calibration date, in numeric format |
fut_matu |
a date for the bond futures' maturity date, in Date format |
option_matu |
a date for the maturity date of the options, in Date format |
start_date |
a date for the observation date, in Date format |
nationality |
a character for the nationality of the issuer of the bond underlying the futures contract, in character format (NA by default) |
currency |
a character for the currency in which the futures contract and the options are traded, in character format (NA by default) |
Value
the mean and standard deviation of each component lognormal density and the weight on the first density (for a mixture of 2) or on the first 2 densities (for a mixture of 3) in numeric format, a discretized domain of the futures price at option's maturity by increments of 0.001 units of the currency of the futures contract, in numeric format, the probability density for each value in the discretized domain in numeric format, the cumulative density for each value in the discretized domain in numeric format, the type of convergence in the optimization in numeric format (0 indicating successful convergence), the mean, standard deviation, skewness and kurtosis of the distribution of the futures price in numeric format, quantiles of order 0.1%, 0.5%, 1%, 5%, 10%, 25%, 50%, 75%, 90%, 95%, 99%, 99.5% and 99.9% of the distribution in numeric format, the mode of the distribution in numeric format, the options' prices predicted by the model in numeric format, a plot of the RND and a plot of the CDF of the futures price
Examples
bond_future_price(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,
1,
3,
as.Date("2033-11-01"),
116.17,
as.Date("2024-12-10"),
as.Date("2024-11-22"),
as.Date("2024-06-14"),
"Italian",
"EUR")
bond_yield_spread
Description
bond_yield_spread
Usage
bond_yield_spread(
call_prices_1,
call_strikes_1,
put_prices_1,
put_strikes_1,
call_prices_2,
call_strikes_2,
put_prices_2,
put_strikes_2,
r,
r_2,
day_count_conv_1,
day_count_conv_2,
cot_1,
cot_2,
ctd_matu_1,
ctd_matu_2,
fut_price_1,
fut_price_2,
fut_matu,
option_matu,
start_date,
bond_ISIN_1,
bond_coupon_1,
bond_cp_f_1,
bond_matu_1,
bond_conv_factor_1,
bond_ytm_1,
sett_1,
bond_ISIN_2,
bond_coupon_2,
bond_cp_f_2,
bond_matu_2,
bond_conv_factor_2,
bond_ytm_2,
sett_2,
bond_nomi = 100,
corr,
ctry_1 = NA,
ctry_2 = NA
)
Arguments
call_prices_1 |
a vector of call prices on the first bond futures, in numeric format |
call_strikes_1 |
a vector of call strikes attached to the call prices, in numeric format |
put_prices_1 |
a vector of put prices on the first bond futures, in numeric format |
put_strikes_1 |
a vector of put strikes attached to the put prices, in numeric format |
call_prices_2 |
a vector of call prices on the second bond futures, in numeric format |
call_strikes_2 |
a vector of call strikes attached to the call prices, in numeric format |
put_prices_2 |
a vector of put prices on the second bond futures, in numeric format |
put_strikes_2 |
a vector of put strikes attached to the put prices, in numeric format |
r |
a number for the riskfree spot rate whose maturity is equal to the options' maturity, in numeric format |
r_2 |
a number for the riskfree spot rate whose maturity is equal to the futures contracts' maturity, in numeric format |
day_count_conv_1 |
a number for the day count convention of the first bond futures, 1 for ACT/ACT, 2 for ACT/360, 3 for ACT/365 and 4 for 30/360, in numeric format |
day_count_conv_2 |
a number for the day count convention of the second bond futures, 1 for ACT/ACT, 2 for ACT/360, 3 for ACT/365 and 4 for 30/360, in numeric format |
cot_1 |
a number for style of the options on the first bond futures, 1 for European options, 2 for American options and 3 for American options with futures-style margin, in numeric format |
cot_2 |
a number for style of the options on the second bond futures, 1 for European options, 2 for American options and 3 for American options with futures-style margin, in numeric format |
ctd_matu_1 |
a date for the maturity date of the current Cheapest-to-Deliver Bond of the first bond futures, in Date format |
ctd_matu_2 |
a date for the maturity date of the current Cheapest-to-Deliver Bond of the second bond futures, in Date format |
fut_price_1 |
a number for the first bond futures' price on calibration date, in numeric format |
fut_price_2 |
a number for the second bond futures' price on calibration date, in numeric format |
fut_matu |
a date for the bond futures' maturity date, in Date format |
option_matu |
a date for the maturity date of the options, in Date format |
start_date |
a date for the observation date, in Date format |
bond_ISIN_1 |
a vector of ISIN codes for the bonds in the delivery basket of the first bond futures, in character format |
bond_coupon_1 |
a vector of the corresponding coupon rates for the bonds in the delivery basket, in numeric format |
bond_cp_f_1 |
a vector of the corresponding frequencies of coupon payment, either 1 for annual payment or 2 for semiannual payment, in numeric format |
bond_matu_1 |
a vector of the corresponding maturity dates for the bonds in the basket of deliverable bonds, in Date format |
bond_conv_factor_1 |
a vector of the corresponding conversion factors for the bonds in the delivery basket, in numeric format |
bond_ytm_1 |
a vector of the corresponding yield to maturities at observation date for the bonds in the delivery basket, in numeric format |
sett_1 |
a number for the number of days between the ex-coupon date and the coupon payment date of the bonds in the delivery basket, in numeric format |
bond_ISIN_2 |
a vector of ISIN codes for the bonds in the delivery basket of the second bond futures, in character format |
bond_coupon_2 |
a vector of the corresponding coupon rates for the bonds in the delivery basket, in numeric format |
bond_cp_f_2 |
a vector of the corresponding frequencies of coupon payment, either 1 for annual payment or 2 for semiannual payment, in numeric format |
bond_matu_2 |
a vector of the corresponding maturity dates for the bonds in the basket of deliverable bonds, in Date format |
bond_conv_factor_2 |
a vector of the corresponding conversion factors for the bonds in the delivery basket, in numeric format |
bond_ytm_2 |
a vector of the corresponding yield to maturities at observation date for the bonds in the delivery basket, in numeric format |
sett_2 |
a number for the number of days between the ex-coupon date and the coupon payment date of the bonds in the delivery basket, in numeric format |
bond_nomi |
a single number for the nominal of the bonds (100 by default) in numeric format |
corr |
a number for the correlation coefficient between the returns on the two bond futures prices with identical maturity, in numeric format |
ctry_1 |
a character for the nationality of the issuer of the bond in the first bond futures, in character format (NA by default) |
ctry_2 |
a character for the nationality of the issuer of the bond in the second bond futures, in character format (NA by default) |
Value
10,000 realizations of the bond yield spread between two different issuers or two issues of the same issuer with different maturities, using options on two bond futures with the same maturity, and a density plot of the spread, in bps
Examples
bond_yield_spread(
c(12.64, 12.14, 11.65, 11.15, 10.65, 10.15, 9.65, 9.16, 8.66,
8.16, 7.67, 7.17, 6.68, 6.19, 5.70, 5.21, 4.73, 4.25, 3.78, 3.32,
2.87, 2.45, 2.05, 1.67, 1.33, 1.03, 0.77, 0.57, 0.41, 0.29,
0.21, 0.15, 0.10, 0.07, 0.06, 0.04, 0.04, 0.03, 0.02, 0.02, 0.02,
0.02, 0.01, 0.01, 0.01, 0.01, 0.01),
c(seq(114, 136.5, 0.5), 137.5),
c(0.01, 0.01, 0.02, 0.02, 0.02, 0.02, 0.02, 0.03, 0.03, 0.03, 0.04, 0.04,
0.05, 0.06, 0.07, 0.08, 0.10, 0.12, 0.15, 0.19, 0.24, 0.32, 0.42, 0.54,
0.70, 0.90, 1.14, 1.44, 1.78, 2.16, 2.58, 3.02, 3.47, 3.94, 4.43, 4.91,
5.41, 5.90, 6.39, 6.89, 7.39, 7.89, 8.38, 8.88, 9.38, 9.88, 10.88),
c(seq(114, 136.5, 0.5), 137.5),
c(13.46, 12.96, 12.46, 11.96, 11.47, 10.97, 10.47, 9.98, 9.48, 8.99, 8.49,
8.00, 7.51, 7.02, 6.53, 6.04, 5.56, 5.08, 4.61, 4.15, 3.69, 3.25, 2.82,
2.41, 2.02, 1.67, 1.34, 1.05, 0.80, 0.59, 0.43, 0.30, 0.21, 0.14, 0.09,
0.06, 0.04, 0.02, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01),
seq(105.5, 129, 0.5),
c(0.02, 0.02, 0.02, 0.02, 0.03, 0.03, 0.03, 0.04, 0.04, 0.05, 0.05, 0.06,
0.07, 0.08, 0.09, 0.10, 0.12, 0.14, 0.17, 0.21, 0.25, 0.31, 0.38, 0.47,
0.58, 0.73, 0.90, 1.11, 1.36, 1.65, 1.99, 2.36, 2.77, 3.20, 3.65, 4.12,
4.60, 5.08, 5.57, 6.07, 6.57, 7.06, 7.56, 8.06, 8.56, 9.06, 9.56, 10.06),
seq(105.5, 129, 0.5),
0.0187,
0.019,
1,
1,
3,
3,
as.Date("2035-08-15"),
as.Date("2035-08-01"),
126.66,
119.04,
as.Date("2026-09-08"),
as.Date("2026-08-21"),
as.Date("2026-06-17"),
c("DE000BU2Z056", "DE000BU2Z064"),
c(0.026, 0.029),
rep(1, 2),
as.Date(c("2035-08-15", "2036-02-15")),
c(0.770088, 0.781249),
c(0.02898, 0.02926),
2,
c("IT0005631590", "IT0005648149", "IT0005676504", "IT0005402117",
"IT0005706285", "IT0005433195"),
c(0.0365, 0.0360, 0.0345, 0.0145, 0.0380, 0.0095),
rep(2, 6),
as.Date(c("2035-08-01", "2035-10-01", "2036-02-01", "2036-03-01",
"2036-07-01", "2037-03-01")),
c(0.845212, 0.839556, 0.824415, 0.679587, 0.844354, 0.616457),
c(0.03567, 0.03587, 0.03620, 0.03614, 0.03665, 0.03712),
2,
100,
0.4,
"Germany",
"Italy")
ctd_bond_yield
Description
ctd_bond_yield
Usage
ctd_bond_yield(
call_prices,
call_strikes,
put_prices,
put_strikes,
nb_log,
r,
r_2,
day_count_conv,
cot,
conv_factor,
ctd_cp,
ctd_matu,
cp_f,
ctd_N,
sett,
fut_price,
fut_matu,
option_matu,
start_date,
nationality = NA,
currency = NA
)
Arguments
call_prices |
a vector of call prices on a bond futures, in numeric format |
call_strikes |
a vector of call strikes attached to the call prices, in numeric format |
put_prices |
a vector of put prices on a bond futures, in numeric format |
put_strikes |
a vector of put strikes attached to the put prices, in numeric format |
nb_log |
a number for the number of component densities in the lognormal mixture to model the bond futures' price, either 2 or 3, in numeric format |
r |
a number for the riskfree spot rate whose maturity is equal to the options' maturity, in numeric format |
r_2 |
a number for the riskfree spot rate whose maturity is equal to the futures contract's maturity, in numeric format |
day_count_conv |
a number for the day count convention, 1 for ACT/ACT, 2 for ACT/360, 3 for ACT/365 and 4 for 30/360, in numeric format |
cot |
a number for the options' style, 1 for European options, 2 for American options and 3 for American options with futures-style margin, in numeric format |
conv_factor |
a number for the conversion factor assigned by the futures exchange to the current Cheapest-to-Deliver Bond of the bond futures, in numeric format |
ctd_cp |
a number for the coupon rate of the current Cheapest-to-Deliver Bond, in numeric format |
ctd_matu |
a date for the maturity date of the current Cheapest-to-Deliver Bond, in Date format |
cp_f |
a number for the frequency of coupon payment of the current Cheapest-to-Deliver Bond, either 1 if the frequency is annual or 2 if semi-annual |
ctd_N |
a number for the value of the principal of the current Cheapest-to-Deliver Bond, in numeric format |
sett |
a number for the number of days between the ex-coupon date and the coupon payment date of the current Cheapest-to-Deliver Bond, in numeric format |
fut_price |
a number for the bond futures' price on calibration date, in numeric format |
fut_matu |
a date for the maturity date of the bond futures contract, in Date format |
option_matu |
a date for the maturity date of the options, in Date format |
start_date |
a date for the observation date, in Date format |
nationality |
a character for the nationality of the issuer of the bond underlying the futures contract, in character format (NA by default) |
currency |
a character for the currency in which the futures contract and the options are traded, in character format (NA by default) |
Value
A discretized domain of the current Cheapest-to-Deliver bond yield at option's maturity in numeric format, the probability density for each value in the discretized domain in numeric format, the cumulative density for each value in the discretized domain in numeric format, the type of convergence in the optimization in numeric format (0 indicating successful convergence), the mean, standard deviation, skewness and kurtosis of the distribution of the current Cheapest-to-Deliver bond yield in numeric format, quantiles of order 0.1%, 0.5%, 1%, 5%, 10%, 25%, 50%, 75%, 90%, 95%, 99%, 99.5% and 99.9% of the distribution in numeric format, the mode of the distribution in numeric format, a plot of the RND and a plot of the CDF of the current Cheapest-to-Deliver bond yield
Examples
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"),
2,
100,
2,
116.17,
as.Date("2024-12-10"),
as.Date("2024-11-22"),
as.Date("2024-06-14"),
"Italian",
"EUR")
deliv_bonds_charac_bbg
Description
deliv_bonds_charac_bbg
Usage
deliv_bonds_charac_bbg(bbg_ticker, date)
Arguments
bbg_ticker |
a Bloomberg ticker of a bond futures contract, in character format |
date |
a date for the recovery of the characteristics of the deliverable bonds in the futures contract, in Date format |
Value
For the bonds in the delivery basket, their ISIN code in character format, their coupon rate and frequency of coupon payment in numeric format (1 for annual and 2 for semi-annual), their maturity date in Date format, their conversion factor, yield to maturity and day count convention in numeric format (1 for ACT/ACT, 2 for ACT/360, 3 for ACT/365 and 4 for 30/360). Provided physical delivery of the contract, the same information is also displayed for the current Cheapest-to-Deliver Bond in a second table, with in addition its net basis in currency units of the futures contract, as calculated by Bloomberg, in numeric format
Examples
## Not run:
deliv_bonds_charac_bbg("UBU6", as.Date("2026-05-19"))
## End(Not run)
option_prices_bbg
Description
option_prices_bbg
Usage
option_prices_bbg(fut_bbg_ticker, date)
Arguments
fut_bbg_ticker |
a single Bloomberg ticker of a STIR or bond futures contract, in character format |
date |
a date for the recovery of options' closing prices, in Date format |
Value
provided there are listed options on the futures, call and put options strike prices and attached call and put options closing market prices in numeric format, the maturity date of the options in Date format, the option's style in character format, the option's currency in character format, the listing place of the options in character format, the closing price of the futures contract in numeric format. When options of different maturities are listed on the same futures contract, this information concerns options whose maturity date is closest to the maturity date of the futures contract.
Examples
## Not run:
option_prices_bbg("ERM6", as.Date("2026-03-20"))
## End(Not run)
proba_ctd
Description
proba_ctd
Usage
proba_ctd(
call_prices,
call_strikes,
put_prices,
put_strikes,
nb_log,
r,
day_count_conv,
cot,
ctd_matu,
fut_price,
fut_matu,
option_matu,
start_date,
bond_ISIN,
bond_coupon,
bond_cp_f,
bond_matu,
bond_nomi = 100,
bond_conv_factor,
bond_ytm,
sett
)
Arguments
call_prices |
a vector of call prices, in numeric format |
call_strikes |
a vector of call strikes attached to the call prices, in numeric format |
put_prices |
a vector of put prices, in numeric format |
put_strikes |
a vector of put strikes attached to the put prices, in numeric format |
nb_log |
a number for the number of lognormal densities in the lognormal mixture to model the futures contracts, either 2 or 3, in numeric format |
r |
a number for the riskfree spot rate whose maturity is equal to the option's maturity, in numeric format |
day_count_conv |
a number for the day count convention, 1 for ACT/ACT, 2 for ACT/360, 3 for ACT/365 and 4 for 30/360, in numeric format |
cot |
a number for the options' style, 1 for European options, 2 for American options and 3 for American options with futures-style margin, in numeric format |
ctd_matu |
a date for the maturity date of the current Cheapest-to-Deliver Bond in the basket of deliverable bonds of the futures contract, in Date format |
fut_price |
a number for the futures contract price on calibration date, in numeric format |
fut_matu |
a date for the maturity date of the futures contract, in Date format |
option_matu |
a date for the maturity date of the options, in Date format |
start_date |
a date for the observation date, in Date format |
bond_ISIN |
a vector of ISIN codes for the bonds in the delivery basket, in character format |
bond_coupon |
a vector of the corresponding coupon rates for the bonds in the delivery basket, in numeric format |
bond_cp_f |
a vector of the corresponding frequencies of coupon payment, either 1 for annual payment or 2 for semiannual payment, in numeric format |
bond_matu |
a vector of the corresponding maturity dates for the bonds in the basket of deliverable bonds, in Date format |
bond_nomi |
a single number for the nominal of the bonds (100 by default) in numeric format |
bond_conv_factor |
a vector of the corresponding conversion factors for the bonds in the delivery basket, in numeric format |
bond_ytm |
a vector of the corresponding yield to maturities at observation date for the bonds in the delivery basket, in numeric format |
sett |
a number for the number of days between the ex-coupon date and the coupon payment date of the current Cheapest-to-Deliver Bond, in numeric format |
Value
for the bonds in the delivery basket, their ISIN in character format and their probability of being the CtD bond at futures' maturity in numeric format
Examples
proba_ctd( c(24.10, 23.10, 22.12, 21.12, 20.12, 19.14, 18.14, 17.16, 16.18, 15.20,
14.22, 13.24, 12.28, 11.32, 10.36, 9.44, 8.50, 7.60, 6.72, 5.86, 5.04, 4.28,
3.56, 2.88, 2.30, 1.78, 1.36, 1.02, 0.76, 0.56, 0.42, 0.30, 0.22, 0.18, 0.14,
0.10, 0.08, 0.06, 0.06, 0.04, 0.04, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02),
seq(85, 131),
c(0.02, 0.02, 0.02, 0.02, 0.02, 0.04, 0.04, 0.06, 0.08, 0.10, 0.12, 0.14, 0.18, 0.22,
0.26, 0.34, 0.40, 0.50, 0.62, 0.76, 0.94, 1.18, 1.46, 1.78, 2.20, 2.68, 3.26, 3.92,
4.66, 5.46, 6.32, 7.20, 8.12, 9.08, 10.04, 11.00, 11.98, 12.96, 13.96, 14.94, 15.94,
16.92, 17.92, 18.92, 19.92, 20.92, 21.92),
seq(85, 131),
2,
0.0187,
1,
3,
as.Date("2054-08-15"),
109.1,
as.Date("2026-09-08"),
as.Date("2026-08-21"),
as.Date("2026-05-28"),
c("DE0001102572", "DE0001102614", "DE0001030757", "DE000BU2D004", "DE000BU2D012"),
c(0.000, 0.018, 0.018, 0.025, 0.029),
rep(1, 5),
as.Date(c("2052-08-15", "2053-08-15", "2053-08-15", "2054-08-15", "2056-08-15")),
100,
c(0.361698, 0.641260, 0.641260, 0.750372, 0.809987),
c(0.03500, 0.03507, 0.03492, 0.03510, 0.03514),
2)
proba_ctd_opt
Description
proba_ctd_opt
Usage
proba_ctd_opt(
call_prices,
call_strikes,
put_prices,
put_strikes,
nb_log,
r,
r_2,
day_count_conv,
cot,
ctd_matu,
fut_price,
fut_matu,
option_matu,
start_date,
bond_ISIN,
bond_coupon,
bond_cp_f,
bond_matu,
bond_nomi = 100,
bond_conv_factor,
bond_ytm,
sett
)
Arguments
call_prices |
a vector of call prices on a bond futures, in numeric format |
call_strikes |
a vector of call strikes attached to the call prices, in numeric format |
put_prices |
a vector of put prices on a bond futures, in numeric format |
put_strikes |
a vector of put strikes attached to the put prices, in numeric format |
nb_log |
a number for the number of component densities in the lognormal mixture to model the bond futures' price, either 2 or 3, in numeric format |
r |
a number for the riskfree spot rate whose maturity is equal to the options' maturity, in numeric format |
r_2 |
a number for the riskfree spot rate whose maturity is equal to the futures' maturity, in numeric format |
day_count_conv |
a number for the day count convention, 1 for ACT/ACT, 2 for ACT/360, 3 for ACT/365 and 4 for 30/360, in numeric format |
cot |
a number for the options' style, 1 for European options, 2 for American options and 3 for American options with futures-style margin, in numeric format |
ctd_matu |
a date for the maturity date of the current Cheapest-to-Deliver Bond of the bond futures, in Date format |
fut_price |
a number for the bond futures' price on calibration date, in numeric format |
fut_matu |
a date for the bond futures' maturity date, in Date format |
option_matu |
a date for the maturity date of the options, in Date format |
start_date |
a date for the observation date, in Date format |
bond_ISIN |
a vector of ISIN codes for the bonds in the delivery basket of the bond futures, in character format |
bond_coupon |
a vector of the corresponding coupon rates for the bonds in the delivery basket, in numeric format |
bond_cp_f |
a vector of the corresponding frequencies of coupon payment, either 1 for annual payment or 2 for semiannual payment, in numeric format |
bond_matu |
a vector of the corresponding maturity dates for the bonds in the basket of deliverable bonds, in Date format |
bond_nomi |
a single number for the nominal of the bonds (100 by default) in numeric format |
bond_conv_factor |
a vector of the corresponding conversion factors for the bonds in the delivery basket, in numeric format |
bond_ytm |
a vector of the corresponding yield to maturities at observation date for the bonds in the delivery basket, in numeric format |
sett |
a number for the number of days between the ex-coupon date and the coupon payment date of the bonds in the delivery basket, in numeric format |
Value
for the bonds in the delivery basket, their ISIN in character format and their probability of being the CtD bond at options' maturity, in numeric format
Examples
proba_ctd_opt( c(24.10, 23.10, 22.12, 21.12, 20.12, 19.14, 18.14, 17.16, 16.18, 15.20,
14.22, 13.24, 12.28, 11.32, 10.36, 9.44, 8.50, 7.60, 6.72, 5.86, 5.04, 4.28,
3.56, 2.88, 2.30, 1.78, 1.36, 1.02, 0.76, 0.56, 0.42, 0.30, 0.22, 0.18, 0.14,
0.10, 0.08, 0.06, 0.06, 0.04, 0.04, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02),
seq(85, 131),
c(0.02, 0.02, 0.02, 0.02, 0.02, 0.04, 0.04, 0.06, 0.08, 0.10, 0.12, 0.14, 0.18, 0.22,
0.26, 0.34, 0.40, 0.50, 0.62, 0.76, 0.94, 1.18, 1.46, 1.78, 2.20, 2.68, 3.26, 3.92,
4.66, 5.46, 6.32, 7.20, 8.12, 9.08, 10.04, 11.00, 11.98, 12.96, 13.96, 14.94, 15.94,
16.92, 17.92, 18.92, 19.92, 20.92, 21.92),
seq(85, 131),
2,
0.0187,
0.019,
1,
3,
as.Date("2054-08-15"),
109.1,
as.Date("2026-09-08"),
as.Date("2026-08-21"),
as.Date("2026-05-28"),
c("DE0001102572", "DE0001102614", "DE0001030757", "DE000BU2D004", "DE000BU2D012"),
c(0.000, 0.018, 0.018, 0.025, 0.029),
rep(1, 5),
as.Date(c("2052-08-15", "2053-08-15", "2053-08-15", "2054-08-15", "2056-08-15")),
100,
c(0.361698, 0.641260, 0.641260, 0.750372, 0.809987),
c(0.03500, 0.03507, 0.03492, 0.03510, 0.03514),
2)
stir_future_charac_bbg
Description
stir_future_charac_bbg
Usage
stir_future_charac_bbg(bbg_tickers)
Arguments
bbg_tickers |
a vector of Bloomberg tickers of STIR futures contracts, in character format |
Value
for each STIR futures contract, its maturity date in Date format, its currency, its listing place and its underlying asset all in character format
Examples
## Not run:
stir_future_charac_bbg(c("FFU24", "ERM6"))
## End(Not run)
stir_future_price
Description
stir_future_price
Usage
stir_future_price(
call_prices,
call_strikes,
put_prices,
put_strikes,
nb_log,
r,
day_count_conv,
cot,
fut_price,
fut_matu,
option_matu,
start_date,
ref_rate = NA,
currency = NA
)
Arguments
call_prices |
a vector of call prices on a STIR futures, in numeric format |
call_strikes |
a vector of call strikes attached to the call prices, in numeric format |
put_prices |
a vector of put prices on a STIR futures, in numeric format |
put_strikes |
a vector of put strikes attached to the put prices, in numeric format |
nb_log |
a number for the number of component densities in the lognormal mixture to model the STIR futures' price, either 2 or 3, in numeric format |
r |
a number for the riskfree spot rate whose maturity is equal to the options' maturity, in numeric format |
day_count_conv |
a number for the day count convention, 1 for ACT/ACT, 2 for ACT/360, 3 for ACT/365 and 4 for 30/360, in numeric format |
cot |
a number for the options' style, 1 for European options, 2 for American options and 3 for American options with futures-style margin, in numeric format |
fut_price |
a number for the STIR futures' price on calibration date, in numeric format |
fut_matu |
a date for the STIR futures' maturity date, in Date format |
option_matu |
a date for the maturity date of the options, in Date format |
start_date |
a date for the observation date, in Date format |
ref_rate |
a character for the name of the STIR, in character format (NA by default) |
currency |
a character for the currency in which the STIR futures contract and the options are traded, in character format (NA by default) |
Value
the mean and standard deviation of each component lognormal density and the weight on the first density (for a mixture of 2) or on the first 2 densities (for a mixture of 3) in numeric format, a discretized domain of the futures price at option's maturity by increments of 0.001 units of the currency of the futures contract, in numeric format, the probability density for each value in the discretized domain in numeric format, the cumulative density for each value in the discretized domain in numeric format, the type of convergence in the optimization in numeric format (0 indicating successful convergence), the mean, standard deviation, skewness and kurtosis of the distribution of the futures price in numeric format, quantiles of order 0.1%, 0.5%, 1%, 5%, 10%, 25%, 50%, 75%, 90%, 95%, 99%, 99.5% and 99.9% of the distribution in numeric format, the mode of the distribution in numeric format, the options' prices predicted by the model in numeric format, a plot of the RND and a plot of the CDF of the futures price
Examples
stir_future_price( c(1.44500, 1.32000, 1.19750, 1.07500, 0.95750,
0.84250, 0.78750, 0.73250, 0.68000, 0.62750, 0.57750, 0.53000, 0.48500,
0.44000, 0.39750, 0.35750, 0.32000, 0.28500, 0.25250, 0.22250, 0.19500,
0.17000, 0.14750, 0.12750, 0.10750, 0.09250, 0.07750, 0.06500, 0.05500,
0.04500, 0.03750, 0.03000, 0.02500, 0.02000, 0.01500, 0.01250, 0.01000,
0.00750, 0.00500, 0.00500, 0.00250, 0.00250, 0.00250, 0.00250,
rep(0.00024, 47)),
c(seq(93.25, 93.875, 0.125), seq(93.9375, 98.8125, 0.0625),
seq(98.875, 99.5, 0.125)),
c(0.0025, 0.0050, 0.0075, 0.0125, 0.0175, 0.0300, 0.0350, 0.0425, 0.0525,
0.0625, 0.0750, 0.0900, 0.1050, 0.1225, 0.1425, 0.1650, 0.1900, 0.2175,
0.2450, 0.2775, 0.3125, 0.3500, 0.3875, 0.4300, 0.4725, 0.5175, 0.5675,
0.6150, 0.6675, 0.7200, 0.7750, 0.8300, 0.8850, 0.9425, 1.0025, 1.0625,
1.1225, 1.1825, 1.2425, 1.3050, 1.3675, 1.4300, 1.4925, 1.5550, 1.6175,
1.6800, 1.7425, 1.8050, 1.8675, 1.9300, 1.9925, 2.0550, 2.1175, 2.1800,
2.2425, 2.3050, 2.3675, 2.4300, 2.4925, 2.5550, 2.6175, 2.6800, 2.7425,
2.8050, 2.8675, 2.9300, 2.9925, 3.0550, 3.1175, 3.1800, 3.2425, 3.3050,
3.3675, 3.4300, 3.4925, 3.5550, 3.6175, 3.6800, 3.7425, 3.8050, 3.8675,
3.9300, 3.9925, 4.0550, 4.1175, 4.1800, 4.3050, 4.4300, 4.5550, 4.6800,
4.8050),
c(seq(93.25, 93.875, 0.125), seq(93.9375, 98.8125, 0.0625),
seq(98.875, 99.5, 0.125)),
2,
0.0537,
1,
2,
94.7,
as.Date("2024-02-29"),
as.Date("2024-02-25"),
as.Date("2023-12-18"),
"fed_fund_rate",
"USD")
stir_rate
Description
stir_rate
Usage
stir_rate(
call_prices,
call_strikes,
put_prices,
put_strikes,
nb_log,
r,
day_count_conv,
cot,
fut_price,
fut_matu,
option_matu,
start_date,
ref_rate = NA,
currency = NA
)
Arguments
call_prices |
a vector of call prices on a STIR futures, in numeric format |
call_strikes |
a vector of call strikes attached to the call prices, in numeric format |
put_prices |
a vector of put prices on a STIR futures, in numeric format |
put_strikes |
a vector of put strikes attached to the put prices, in numeric format |
nb_log |
a number for the number of component densities in the lognormal mixture to model the futures' price, either 2 or 3, in numeric format |
r |
a number for the riskfree spot rate whose maturity is equal to the options' maturity, in numeric format |
day_count_conv |
a number for the day count convention, 1 for ACT/ACT, 2 for ACT/360, 3 for ACT/365 and 4 for 30/360, in numeric format |
cot |
a number for the options' style, 1 for European options, 2 for American options and 3 for American options with futures-style margin, in numeric format |
fut_price |
a number for the STIR futures contract price on calibration date, in numeric format |
fut_matu |
a date for the maturity date of the STIR futures contract, in Date format |
option_matu |
a date for the maturity date of the options, in Date format |
start_date |
a date for the observation date, in Date format |
ref_rate |
a character for the name of the STIR, in character format (NA by default) |
currency |
a character for the currency in which the STIR futures and the options are traded, in character format (NA by default) |
Value
a discretized domain of the future rate at option's maturity by increments of 0.001% in numeric format, the probability density for each value in the discretized domain in numeric format, the cumulative density for each value in the discretized domain in numeric format, the type of convergence in the optimization in numeric format (0 indicating successful convergence), the mean, standard deviation, skewness and kurtosis of the distribution of future rates in numeric format, quantiles of order 0.1%, 0.5%, 1%, 5%, 10%, 25%, 50%, 75%, 90%, 95%, 99%, 99.5% and 99.9% of the distribution in numeric format, the mode of the distribution in numeric format, a plot of the RND and a plot of the CDF of the rate futures
Examples
stir_rate( c(1.44500, 1.32000, 1.19750, 1.07500, 0.95750,
0.84250, 0.78750, 0.73250, 0.68000, 0.62750, 0.57750, 0.53000, 0.48500,
0.44000, 0.39750, 0.35750, 0.32000, 0.28500, 0.25250, 0.22250, 0.19500,
0.17000, 0.14750, 0.12750, 0.10750, 0.09250, 0.07750, 0.06500, 0.05500,
0.04500, 0.03750, 0.03000, 0.02500, 0.02000, 0.01500, 0.01250, 0.01000,
0.00750, 0.00500, 0.00500, 0.00250, 0.00250, 0.00250, 0.00250,
rep(0.00024, 47)),
c(seq(93.25, 93.875, 0.125), seq(93.9375, 98.8125, 0.0625),
seq(98.875, 99.5, 0.125)),
c(0.0025, 0.0050, 0.0075, 0.0125, 0.0175, 0.0300, 0.0350, 0.0425,
0.0525, 0.0625, 0.0750, 0.0900, 0.1050, 0.1225, 0.1425, 0.1650, 0.1900,
0.2175, 0.2450, 0.2775, 0.3125, 0.3500, 0.3875, 0.4300, 0.4725, 0.5175,
0.5675, 0.6150, 0.6675, 0.7200, 0.7750, 0.8300, 0.8850, 0.9425, 1.0025,
1.0625, 1.1225, 1.1825, 1.2425, 1.3050, 1.3675, 1.4300, 1.4925, 1.5550,
1.6175, 1.6800, 1.7425, 1.8050, 1.8675, 1.9300, 1.9925, 2.0550, 2.1175,
2.1800, 2.2425, 2.3050, 2.3675, 2.4300, 2.4925, 2.5550, 2.6175, 2.6800,
2.7425, 2.8050, 2.8675, 2.9300, 2.9925, 3.0550, 3.1175, 3.1800, 3.2425,
3.3050, 3.3675, 3.4300, 3.4925, 3.5550, 3.6175, 3.6800, 3.7425, 3.8050,
3.8675, 3.9300, 3.9925, 4.0550, 4.1175, 4.1800, 4.3050, 4.4300, 4.5550,
4.6800, 4.8050),
c(seq(93.25, 93.875, 0.125), seq(93.9375, 98.8125, 0.0625),
seq(98.875, 99.5, 0.125)),
2,
0.0537,
1,
2,
94.7,
as.Date("2024-02-29"),
as.Date("2024-02-25"),
as.Date("2023-12-18"),
"fed_fund_rate",
"USD")