interpolate_rfr | R Documentation |
According to the 2019 VIX whitepaper, "the risk-free interest rates, R1 and R2, are yields based on U.S. Treasury yield curve rates (commonly referred to as "Constant Maturity Treasury", rates or CMTs), to which a cubic spline is applied to derive yields on the expiration dates of relevant SPX options. As such, the VIX Index calculation may use different risk-free interest rates for near- and next-term options. Note in this example, T2 uses a value of 900 for Settlement day, which reflects the 4:00 p.m. ET expiration time of the next-term SPX Weeklys options."
interpolate_rfr(cmt_data = NULL, date, exp, ret_table = F)
cmt_data |
A |
date |
A |
exp |
A |
ret_table |
|
Returns either a numeric vector
of risk free rates or a data.table
containing:
date(date
) - the provided starting dates
exp (date
) - the provided expiration dates
R (numeric
) - the corresponding risk-free interest rates in decimal
## Using internal package data library(lubridate) ## Single values interpolate_rfr(date = ymd("2020-01-02"), exp = date("2020-03-02")) ## Multiple values dates <- ymd("2020-01-06") + days(1:4) exps <- ymd("2020-03-02") + days(1:4) interpolate_rfr(date = dates, exp = exps) ## With output table interpolate_rfr(date = dates, exp = exps, ret_table = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.