Tag: VIX

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.

Euclidean Distance for Pattern Matching

Most of us have learnt how to calculate the distance between 2 points on a plane in high school. The simplest one is called the Euclidean Distance – a pretty basic application of the Pythagorean Theorem. The concept can be extended to calculate the distance between to vectors. This is where it gets interesting.

Suppose you want to match a price series with another, ranking a rolling window by its Euclidean Distance is the fastest and simplest way of pattern matching.

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 Euclidean Distance (ED.)

Here, the ED has dug up a segment from November-2010 as one of the top 5 matches. Take a closer look:

While not a perfect match, it “sort of” comes close.

Sometimes, a simple tool is good enough to get you 80% of the way. This is one of them.