I've plotted the values for VIX, which is the CBOE's volatility index calculated by some magic formula that considers 30-day expectation of price movement, in the chart below. Next to it is a plot of 30-day returns for the SPX, or a graph that plots all the percentage changes for each 30-day window. Quite frankly, I'm not sure what conclusions to draw from this, except that expectations in markets usually fall short.
The R code:
library(vioplot)
library(quantmod)
VIX <- getSymbols("^VIX", auto.assign=FALSE)[,4]
SPX <- getSymbols("^GSPC", auto.assign=FALSE)[,4]
VIX <- VIX/100
SPX <- Delt(SPX, k=30)
SPX <- na.locf(SPX, na.rm=TRUE)
SPX <- abs(SPX)
vioplot(VIX, SPX, names=c("VIX", "SPX"), col="red3")
title("Violins of Volatility") editorial note: the graph annualizing 30-day returns has been removed.

Thanks for this Milktrader, it is an interesting indeed.
ReplyDeleteIf I understand the plot correctly, the observations low % moves in the SPX is crowded between 0.0 and 0.2, then a tail beyond?
@Thomas Yes, and these are non-negative moves so a 30% rally in a 30-day time span will plot the same as a 30% sell-off in a 30-day time span.
ReplyDeleteSPX stops at 0 (because of the absolute calculation in line 10). I did that because I'm comparing it to VIX, which never registers negative and hardly dips below 10. I'm thinking of volatility as a non-negative variable.
The violin plot is a mirror-image density plot embedded with quantile data in the candle and with the mean being depicted as the white dot.
FYI - I think your plot has a units error. The VIX is annualized which means you should multiply your SPX data by sqrt(365/30) to get consistent units. If you do so, you'll see that the graphs are much more consistent.
ReplyDelete@Rich: oh great. Now I have to redo the plot and draw equally incorrect conclusions from different plot. I say this in jest of course, and greatly appreciate your pointing out my egregious error.
ReplyDeleteHere is a reference to the VIX white paper: www.cboe.com/micro/vix/vixwhite.pdf. Indeed, they do multiply their voodoo by sqrt(360/30).
I believe VIX is supposed to be a quote for ex pected std.dev(returns(s&p 500)) over the next month. Your daily series for ^GSPC should be a rolling std.dev over the next 30 days.
ReplyDeleteYou'll still need to do some version of the annualization magic to get the units right.
@Evan if I were to take daily returns, then it makes sense to take a standard deviation of them, but these are not 1-day returns, rather they are 30-day returns.
ReplyDelete@Rich I agreed with you that I needed to annualize my SPX graph, but now I'm unsure. The VIX people are calculating volatility in the standard deviation sense of the word. My SPX calculation is not that. You could take daily returns and calculate standard deviation at which point some sort of annualization makes sense, particularly if you're doing the so-called rolling correlation dance, which I've never felt completely comfortable with.
ReplyDeleteIn any case, I appreciate your and @Evan's comments.
scaled variance against the vix would make a much better plot.
ReplyDeleteregardless the risk premium makes sense.
@BlackRaven I do admit I'm comparing unlike things. The actual scaled 1 standard deviation based on the last (rolling) 30 days of data would be the classic volatility definition. It doesn't take much more code to change the non-standard approach I'm taking and convert it to the classic version.
ReplyDeleteI'm pretty sure that the VIX is an annualized estimate of the 30-day volatility.
ReplyDeleteFor your SPX comparison, your violin plot shows the distribution of the absolute value of 30-day percentage changes in SPX. Hence, the center of the distribution you are making is the average absolute value. If you were calculating 30-day volatility you'd typically compute the standard deviation but, for normally distributed percentage changes, the average absolute value differs only by a factor of sqrt(2/pi) from the standard deviation. Therefore your number can be compared with a standard deviation if you divide it by sqrt(2/pi) (or multiply it by sqrt(pi/2)).
However, since the VIX annualizes their monthly volatility with a factor of sqrt(360/30), you also need that factor to make a fair comparison.
I reran your posted code but added a factor of sqrt(pi/2)*sqrt(360/30) to the line where you compute abs(SPX). I found that the violin plot for the SPX was much wider than that of the VIX but the means were very similar:
> mean(SPX);mean(VIX)
[1] 0.2417703
[1] 0.2560043
I think this is the comparison graph you were originally trying to make.
@Rich, how would distinguish between an annualized estimate of 30-day volatility and a non-annualized estimate of 30-day volatility? In both cases, your aim is to reveal your expectation of what volatility will be 30-days out.
ReplyDeleteVIX, as I'm sure you understand, takes two groups of options and adds them together. It takes one group as those with less than 30-days to expiry and the second group as those with greater than 30-days to expiry. But in the end, VIX aims to speak to what option traders expect the SPX trading range to be in the next 30-days, 68% of the time.
My plot of 30-day returns is not a statistical best guess but rather a historical record.
I'll admit that I don't understand why "average absolute value differs only by a factor of sqrt(2/pi) from the standard deviation". But now I have something to contemplate.