Tag: VIX

CGMM for VIX

Previously, we explored using Meta’s Prophet library to predict VIX. It turned out that simply extrapolating the last value of the index worked better (Prophet for VIX). In fact, locf (last one carried forward) works better than GARCH(1, 1) and most other approaches. Can the same be said about Conditional Gaussian Mixture Models?

We used the cgmm python library to forecast 20-day forward VIX and compared its root-mean-squared errors (rmse) to those of locf‘s.

locf is pretty hard to beat.

Especially so when the VIX index itself is volatile.

Code up on github.

Prophet for VIX

Open sourced by Meta back in 2017, Prophet is a procedure for forecasting time series data. How does it compare to GARCH(1,1) and locf (last one carried forward) for forecasting VIX 20 days out?

We fit 500-days of rolling VIX data using Prophet and GARCH(1,1) and forecast forward 20-days. We then calculate the RMSE (Root Mean Squared Error) of the forecast vs. actual of both the models and locf. Plot RMSE of all three.

Ideally, you want the error to be low and the tail of errors to be as short as possible. GARCH(1,1) looks worse than Prophet. However, locf beat both?

When in doubt, take the average.

Code on github.

Also: VIX Seasonality

Historical vs. Implied Volatility

India VIX is a volatility index computed by NSE based on the order book of NIFTY Options. For this, the best bid-ask quotes of near and next-month NIFTY options contracts. India VIX indicates the investor’s perception of the market’s volatility in the near term i.e. it depicts the expected market volatility over the next 30 calendar days. Higher the India VIX values, higher the expected volatility and vice versa. (NSE)

Does the actual volatility come close what the VIX was implying 30 calendar days before? Not always and probably never.

What if it’s pricing something more immediate? Here’s the regression with a 10-day lag:

Regression with no lag:

The relationship between implied and historical is one of those things that are directionally true… sometimes.

Code and charts on github.

VIX Seasonality

Is India VIX seasonal? Yes.

There is a huge amount of dispersion in the daily data when grouped by months. Taking averages of these may not make much sense.

However, when you decompose the series, you get some interesting monthly seasonality.

Zooming into the “season_year” chart:

If you transform the seasonality component and plot it by month, you’ll notice why everybody gets nervous in May.

Code and charts on github.

Hamming Distance

Previously, we discussed how removing information from data can be useful. And our discussion on using Euclidean Distance for Pattern Matching showed how you can use a rolling window to identify matching segments within a time-series. What if we mix the two ideas together?

If you transform a time-series of returns to 0-1, then we can use Hamming distance, a measure the minimum number of substitutions required to change one string into the other (Wikipedia,) as a measure of similarity.

For example, take the most recent 20-day VIX time-series and “match” it with a rolling window of historical 20-day VIX segments and sort it by its Hamming Distance.

Here, on the second row, we see that by just flipping two bits, the 20-day sequence ending on 2020-05-18 matches with the 20-day sequence ending 2021-11-16.
If you are looking for a rough up/down days match, then this is a blistering fast way to compute it.