Since the VIX Index is composed of prices of calls and puts options expiring on an average of 30 days, each option of the chosen maturity date contributes to the VIX Index calculation by a certain amount. This amount is given as the general formula:
Here, T is the time to expiration of the option, R is the risk-free interest rate to expiration of the option, Ki is the strike price of the ith OTM option, and △Ki is the half-difference on either side of Ki such that △Ki= 0.5(Ki+1-Ki-1).
We can represent this formula by the following calculate_contrib_by_strike() function:
In [ ]: def calculate_contrib_by_strike(delta_k, ...