CBOE_VIX_vars: Calculate all variables needed for the calculation of the...

CBOE_VIX_varsR Documentation

Calculate all variables needed for the calculation of the CBOE VIX

Description

This is a wrapper around the CBOE_... functions that performs the calculation of all variables required for the calculation of the squared model free implied volatility (\mjseqn\sigma^2) as per the VIX whitepaper:

\loadmathjax \mjsdeqn\sigma

^2 = \frac2T \left(\sum_i \frac\Delta K_iK_i^2 Q(K_i) e^rT \right) - \frac1T \left( \fracF_0K_0 - 1 \right)^2

Usage

CBOE_VIX_vars(option_quotes, R, maturity, ret_vars = F)

Arguments

option_quotes

A data.table or "nest" of option quotes with three columns:

  • K (numeric) - strike price in ascending order

  • c (numeric) - call option price

  • p (numeric) - put option price

R

numeric scalar giving the risk-free rate \mjseqnR corresponding to the maturity \mjseqnT in decimal

maturity

numeric scalar giving the time to maturity \mjseqnT in years

ret_vars

A logical scalar - if true, all VIX variables are returned, else only \mjseqn\sigma^2 is returned.

Value

Returns either a numeric scalar giving \mjseqn\sigma^2 or a list with all variables involved in the calculation:

  • F_0 (numeric) - theoretical at-the money forward \mjseqnF_0 (see CBOE_F_0)

  • K_0 (numeric) - theoretical at-the money strike \mjseqnK_0 (see CBOE_K_0)

  • n_put_raw (numeric) - number of put options before option selection (see CBOE_option_selection)

  • n_call_raw (numeric) - number of call options before option selection (see CBOE_option_selection)

  • n_put (numeric) - number of put options after option selection

  • n_call (numeric) - number of call options after option selection

  • sigma_sq (numeric) - squared model free implied volatility \mjseqn\sigma^2 (see CBOE_sigma_sq)

Examples


library(R.MFIV)

nest <- option_dataset$option_quotes[[1]]
CBOE_VIX_vars(option_quotes = nest,
              R = 0.005,
              maturity = 0.07,
              ret_vars = TRUE)


m-g-h/R.MFIV documentation built on July 4, 2022, 3:35 a.m.